Constructor Basics QuizS2C Home « Constructor Basics Quiz

Java Objects & Classes Quiz 10

The quiz below tests your knowledge of the material learnt in Objects & Classes - Lesson 10 - Constructor Basics.

Question 1 : How many arguments in a default constructor?
- The default constructor has no arguments.
Question 2 : What differentiates a constructor and a method?
- Constructors have no return type.
Question 3 : The compiler always provides a default constructor?
- The compiler only provides a default constructor when no other constructors are present.
Question 4 : Apart from instantiation what are constructors used for?
- Apart from instantiation constructors are used for initialising object state.
Question 5 : We can name constructors whatever we like as long as we follow naming conventions?
- Constructors must be named after the class they reside in.
Question 6 : Constructors run when a class is loaded?
- A constructor runs when we code the <code>new</code> keyword followed by a class name.
Question 7 : We can provide our own default constructor?
- We CAN provide our own default constructor if we so choose
Quiz Progress Bar Please select an answer


What's Next?

in the next quiz we test your knowledge of constructor overloading and using the this keyword.