C sharp interview Questions with Answers

C# interview Questions with answers-- Asked at different competitive exams

Q21. An ________ is an abstract class which has only public abstract methods, and the methods only have the declaration and not the definition.

A enumeration
B using class
C Interface
D polymorphisum
E None of these

Answer: C
Hint or Explanation An interface is an abstract class which has only public abstract methods, and the methods only have the declaration and not the definition.

Q22.What is the main difference between an Array and Arraylist?

A Array size fixed at Array,but Arraylist not fixed size
B Arraylist size fixed at Array,but Array not fixed size
C same data type values allowed to Array,but Arraylist allowed different data type values
D same data type values allowed to Arraylisr,but Array allowed different data type values
E None of above

Answer A

Hint or Explanation Arrays are strongly-typed collections of the same data type and have a fixed length that cannot be changed during runtime. We can access the Array elements by numeric index. The array indexes start at zero. The default value of numeric array elements is set to zero, and the reference elements are set to null.
An Arraylist is not a strongly-typed collection. It can store the values of different data types or same datatype. The size of an array list increases or decreases dynamically so it can take any size of values from any data type. ArrayList is one of the most flexible data structures from C# Collections. ArrayList contains a simple list of values.

Q23.Can possible to a private virtual method can be overridden?

A yes
B NO
C New version of .Net 3.0 possible
D Warning shows only
E Runtime error occur

Answer B

Hint or Explanation No.

Q24._______________ variables/methods are accessible within the same assembly and also from the classes that are derived from this parent class.

A private Internal
B private External
C protected External
D protected Internal
E public

Answer D

Hint or Explanation protected Internal variables/methods are accessible within the same assembly and also from the classes that are derived from this parent class.

More pages : Interview Questions

0 Comments:

Post a Comment