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 classes and objects in C#.NET?
Class is a value type.
Since objects are typically big in size, they are created on the stack.
Objects of smaller size are created on the heap.
Smaller objects that get created on the stack can be given names.
Objects are always nameless.
Correct Answer:
Objects are always nameless.
← Previous Question
Next Question→
More Questions from
Classes and Objects
Which of the following statements is correct about the C#.NET code snippet given below? class Student s1, s2; // Here 'Student' is a user-defined class. s1 = new Student(); s2 = new Student();
Which of the following statements are correct? Instance members of a class can be accessed only through an object of that class. A class can contain only instance data and instance member function. All objects created from a class will occupy equal number of bytes in memory. A class can contain Friend functions. A class is a blueprint or a template according to which objects are created.
Which of the following statements are correct about the this reference? this reference can be modified in the instance member function of a class. Static functions of a class never receive the this reference. Instance member functions of a class always receive a this reference. this reference continues to exist even after control returns from an instance member function. While calling an instance member function we are not required to pass the this reference explicitly.
Which of the following will be the correct output for the C#.NET program given below? namespace CuriousTabConsoleApplication { class Sample { int i; Single j; public void SetData(int i, Single j) { i = i; j = j; } public void Display() { Console.WriteLine(i + " " + j); } } class MyProgram { static void Main(string[ ] args) { Sample s1 = new Sample(); s1.SetData(10, 5.4f); s1.Display(); } } }
Discussion & Comments
No comments yet. Be the first to comment!
Name:
Comment:
Post Comment
Join Discussion
Discussion & Comments