Classes and Objects

Q1:
Which of the following statements are correct about the C#.NET code snippet given below?
sample c;
c = new sample();
  1. It will create an object called sample.
  2. It will create a nameless object of the type sample.
  3. It will create an object of the type sample on the stack.
  4. It will create a reference c on the stack and an object of the type sample on the heap.
  5. It will create an object of the type sample either on the heap or on the stack depending on the size of the object.

A 1, 3

B 2, 4

C 3, 5

D 4, 5

E None of these

ANS:B - 2, 4

No answer description is available. Let's discuss.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.