C#.NET basics interview questions and answers
C# (pronounced “C sharp”) is a simple, modern, object-oriented, and type-safe programming language.
It will immediately be familiar to C and C++ programmers.
C# combines the high productivity of Rapid Application Development (RAD) languages.
There are 3 types of comments in C#.
Single line (//)
Multi (/* */)
Page/XML Comments (///).
Namespace is a logical grouping of class.
There are several characteristics of C# are :
C# does not support #include statement. It uses only using statement.
In C# , class definition does not use a semicolon at the end.
C# does not support multiple code inheritance.
Casting in C# is much safer than in c++.
In C# switch can also be used on string values.
Command line parameters array behave differently in C# as compared to C++.
It is necessary to understand some of the concepts used extensively in object oriented programming.These include
Data abstraction and encapsulation
Yes. Multiple interfaces may be inherited in C#.
Inheritance is deriving the new class from the already existing one.
Scope refers to the region of code in which a variable may be accessed.
public :The keyword public is an access modifier that tells the C# compiler that the Main method is accessible by anyone.
static :The keyword static declares that the Main method is a global one and can be called without creating an instance of the class. The compiler stores the address of the method as the entry point and uses this information to begin execution before any objects are created.
void : The keyword void is a type modifier that states that the Main method does not return any value.