--:--









Quiz for Classes and Objects

Course: JAVA | Subject: Java | Topic: Object-Oriented Programming (OOP)



Logo

Q1: What is a class in Java?

Logo

Q2: What is an object in Java?

Logo

Q3: Which keyword is used to create an object in Java?

Logo

Q4: Which of the following is NOT a feature of OOP?

Logo

Q5: Which method is used as the entry point of a Java class?

Logo

Q6: How many objects can be created from a single class?

Logo

Q7: Which keyword is used to define a class in Java?

Logo

Q8: What does encapsulation mean in Java?

Logo

Q9: Which access modifier provides the highest level of access?

Logo

Q10: Which access modifier hides members from all other classes?

Logo

Q11: What is the default access modifier for a class in Java?

Logo

Q12: What is constructor overloading?

Logo

Q13: What is the name of a constructor?

Logo

Q14: Can a class have more than one constructor?

Logo

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

Logo

Q16: Can constructors be overloaded in Java?

Logo

Q17: Which keyword is used to refer to the current object?

Logo

Q18: Which method is called when an object is created?

Logo

Q19: Which keyword prevents inheritance?

Logo

Q20: Which method is automatically called before garbage collection?

Are you ready to start test? Set your time limit