R

Ram Sharma • 193.86K Points
Coach

Q. Which of the following is/are true about constructors in Java? 
1) Constructor name should be same as class name.
2) If you don't define a constructor for a class, 
    a default parameterless constructor is automatically
    created by the compiler. 
3) The default constructor calls super() and initializes all 
   instance variables to default value like 0, null.
4) If we want to parent class constructor, it must be called in 
   first line of constructor.

  • (A) 1
  • (B) 1, 2
  • (C) 1, 2 and 3
  • (D) 1, 2, 3 and 4

No solution found for this question.
Add Solution and get +2 points.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.