--:--









Quiz for Defining classes and objects

Course: C++ Language | Subject: Unit 4 | Topic: Classes and Objects



Logo

Q1: Which keyword is used to define a class in C++?

Logo

Q2: How do you create an object of a class named "Car"?

Logo

Q3: Where are data members declared in a class?

Logo

Q4: Which section of a class controls access to its members?

Logo

Q5: What is the default access specifier for members of a class?

Logo

Q6: What syntax is used to define a member function outside the class?

Logo

Q7: Which of the following correctly declares a constructor?

Logo

Q8: How do you access a public data member "age" of an object "obj"?

Logo

Q9: What is the purpose of the "this" pointer?

Logo

Q10: What happens if no constructor is defined in a class?

Logo

Q11: How do you define a private data member "id" inside a class?

Logo

Q12: Which keyword is used to make class members accessible from outside?

Logo

Q13: What is an object?

Logo

Q14: Which operator is used to access members via a pointer to an object?

Logo

Q15: How to declare a member function inside a class?

Logo

Q16: Which of the following correctly defines an empty class named "Test"?

Logo

Q17: Which of these statements about classes is TRUE?

Logo

Q18: How do you declare a static data member inside a class?

Logo

Q19: Can a class have private constructors?

Logo

Q20: What is the size of an empty class in C++?

Are you ready to start test? Set your time limit