C Sharp Interview Questions and Answers - 3
Question: 11
What’s the difference between const and read only?
You can initialize read only variables to some runtime values.
Let’s say your program uses current date and time as one of the values that won’t change.
This way you declare
Public read only string DateT= new DateTime().ToString().
Question: 12
Overloaded constructor will call default constructor internally?
No
Question: 13
What’s different about switch statements in C#?
No fall-throughs allowed. Unlike the C++ switch statement, C# does not support an explicit fall through from one case lable to another. If you want, you can use goto a switch-case, or goto default.
Case 1:
Cost += 25;
Break;
Case 2:
Cost += 25;
Goto case 1;
Question: 14
What are features of C#?
Features of C# are as given under:
C# is very powerful and simple language for building interoperable, scalable and robust applications.
With C#, console, windows as well as web applications can be developed
Supports Garbage collection and automatic memory management
Being an object oriented language, it supports data encapsulation, inheritance, polymorphism, method overriding etc.
C# includes native support for the COM and windows based applications.
To avoid any redundancy, the values of the primitive data types are automatically initialized to zeros and reference types like objects and classes etc. are initialized to null
C# doesn’t supports unsafe type casts, pointers and 0 or 1 for Boolean values.
Question: 15
What is partial class?
The concept of partial classes is applied to the long classes for breaking them up into manageable chunks.
That is, class is split into several C# (.cs) files.
Besides being split into several files, there is no difference between partial and a normal class.
On compilation, the compiler tracks down each piece of the splitted class and assemble it into a single unit.
They only thing to take care while splitting the class into separate files is that the name of the class must be consistent in all the files.
Every fragment of a partial class must use the partial keyword in the class declaration.
- C# Interview Questions and Answers for Freshers
- C# Interview Questions for Experienced Professionals
- C# Interview Questions and Answers for Experienced
- C# Interview Questions with Answers Pdf
- C Sharp Interview Questions and Answers
- C Sharp Interview Questions and Answers for Freshers Pdf
- Top 200+ Advanced C# Interview Questions 2019-2020
- C# Programming Online Test Questions and Answers
- C# Algorithm Interview Questions and Answers
Agricultural Structural and Environmental Control MCQ Quiz More
Science Solutions Class 10 Important Questions and Answers More
Science Solutions Class 10 Important Questions and Answers More
Samacheer Kalvi 10th Science Solutions Questions & Answers More
Samacheer Kalvi 10th Science Carbon and Its Compounds Questions More
Logical Reasoning Questions and Answers for Railway Exams More
Banking Abbreviations PDF Free Download More
1000+ Synonyms Questions for CDS/NDA Exam with Answers More
Profit and Loss Questions and Answers for SSC Exams More
TNPSC Group 1, 2 Biology Online Mock Test in English and Tamil More