C# Interview Questions and Answers (958) - Page 43

In C#, which of the below keyword is used for method hiding?

NOTE: This is objective type question, Please click question title for correct answer.
In C#, the property which has only get and set accessors without any logic is?

NOTE: This is objective type question, Please click question title for correct answer.
C# properties doesn't support one of the conditions below. What is that?

NOTE: This is objective type question, Please click question title for correct answer.
In C#, the string which starts with the character '@' is called as?

NOTE: This is objective type question, Please click question title for correct answer.
In C#, what is the string type used to create an empty string?

NOTE: This is objective type question, Please click question title for correct answer.
In C#, the method used to find the position of character in a string is?

NOTE: This is objective type question, Please click question title for correct answer.
In C#, the method used to split the defined string to substrings is?

NOTE: This is objective type question, Please click question title for correct answer.
In C#, the method used to get a part of the string is?

NOTE: This is objective type question, Please click question title for correct answer.
In C#, the method used to find that the string numeric value or not?

NOTE: This is objective type question, Please click question title for correct answer.
In C#, struct is derived from which base type?

NOTE: This is objective type question, Please click question title for correct answer.
In C#, the method used to sort an array in the ascending order is?

NOTE: This is objective type question, Please click question title for correct answer.
In C#, the method used to sort an array in the descending order is?

NOTE: This is objective type question, Please click question title for correct answer.
C# doesn't support one of the following features. Find that?

NOTE: This is objective type question, Please click question title for correct answer.
In C#, the process of grouping the related methods and variables (members) at a place is known as?

NOTE: This is objective type question, Please click question title for correct answer.
In C#, the keyword used to create an object to a class or struct is?

NOTE: This is objective type question, Please click question title for correct answer.
In C#, the following keyword used to allocate the for a class's instance is?

NOTE: This is objective type question, Please click question title for correct answer.
In C#, the keyword used to access the base class members from the derived class is?

NOTE: This is objective type question, Please click question title for correct answer.
In C#, the keyword used to pass the arguments by reference is?

NOTE: This is objective type question, Please click question title for correct answer.
What will happen,when we compile below C# code? private void sum(int a,int b) { return a + b; }

It will give below compile-time error as:-
Since '_Default.sum()' returns void, a return keyword must not be followed by an object expression.
Means if the return type is void,then we need not return any value from code as void returns Nothing.

What will happen,when we compile below C# code? private int Calculate(int a, int b) { int i = a; int j = b; int k = i + j; }

'_Default.Calculate(int,int)': not all code paths return a value
Above error means if we have defined any method with return type then we have to explicitly return that type otherwise it will not compile and will throw above error.So we have to re-write below code as:-
private int Calculate(int a, int b)

{
int i = a;
int j = b;
int k = i + j;
return k;
}

Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Interview Questions and Answers Categories