C# Programming - Constructors
Exercise : Constructors - General Questions
- Constructors - General Questions
6.
Which of the following is the correct way to define the constructor(s) of the Sample class if we are to create objects as per the C#.NET code snippet given below?
Sample s1 = new Sample();
Sample s2 = new Sample(9, 5.6f);
7.
In which of the following should the methods of a class differ if they are to be treated as overloaded methods?
- Type of arguments
- Return type of methods
- Number of arguments
- Names of methods
- Order of arguments
8.
Can static procedures access instance data?
9.
Which of the following statements are correct about constructors in C#.NET?
- Constructors cannot be overloaded.
- Constructors always have the name same as the name of the class.
- Constructors are never called explicitly.
- Constructors never return any value.
- Constructors allocate space for the object in memory.
10.
How many times can a constructor be called during lifetime of the object?
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers