Curioustab
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Aptitude
General Knowledge
Verbal Reasoning
Computer Science
Interview
Home
»
C# Programming
»
Classes and Objects
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();
This is a perfectly workable code snippet.
Since int is a primitive, we cannot use new with it.
Since an int is a primitive, we cannot call the method ToString() using it.
i will get created on stack, whereas j will get created on heap.
Both i and j will get created on heap.
Show Answer
Correct Answer:
This is a perfectly workable code snippet.
← Previous
Next →
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment