--:--









Quiz for Data members and member functions

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



Logo

Q1: What are data members in a class?

Logo

Q2: What are member functions in a class?

Logo

Q3: Can data members be accessed directly outside the class if they are private?

Logo

Q4: Which access specifier allows member functions and data members to be accessible anywhere?

Logo

Q5: Which keyword is used to declare a member function inside a class?

Logo

Q6: What is the correct way to define a member function outside the class?

Logo

Q7: Can a member function access private data members?

Logo

Q8: What happens if no member function is defined to access private data?

Logo

Q9: What are access specifiers?

Logo

Q10: Which of these is NOT an access specifier?

Logo

Q11: Which member function can access the class members using "this" pointer?

Logo

Q12: Can static member functions access non-static data members directly?

Logo

Q13: How are static data members shared?

Logo

Q14: How to call a member function of an object "obj"?

Logo

Q15: What is the default return type of constructor?

Logo

Q16: Can member functions be declared inside a class and defined outside?

Logo

Q17: What is the term for functions that have same name but different parameters?

Logo

Q18: How do you declare a constant data member?

Logo

Q19: Can member functions be declared as const?

Logo

Q20: What is encapsulation?

Are you ready to start test? Set your time limit