topic/Classes and Objects
Start Test
Question No
Title
Type
Marks
645.
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();
MCQ
5
646.
Which of the following statements is correct about the C#.NET code snippet given below?class Sample { private int i; public Single j; private void DisplayData() { Console.WriteLine(i + " " + j); } public void ShowData() { Console.WriteLine(i + " " + j); } }
MCQ
5
647.
Which of the following statements are correct?Instance members of aclasscan be accessed only through an object of thatclass.Aclasscan contain only instance data and instance memberfunction.All objects created from aclasswill occupy equal number of bytes in memory.Aclasscan contain Friend functions.Aclassis a blueprint or a template according to which objects are created.
MCQ
5
648.
Which of the following is the correct way to create an object of theclass Sample?Sample s = new Sample();Sample s;Sample s; s = new Sample();s = new Sample();
MCQ
5