Classes and Objects

Q1:
Which of the following statements is correct about the C#.NET code snippet given below?
int i;
int j = new int();
i = 10;
j = 20; 
String str; 
str = i.ToString(); 
str = j.ToString();

A This is a perfectly workable code snippet.

B
Since int is a primitive, we cannot use new with it.

C
Since an int is a primitive, we cannot call the method ToString() using it.

D
i will get created on stack, whereas j will get created on heap.

E
Both i and j will get created on heap.

ANS:A - This is a perfectly workable code snippet.

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.