Constructors And Methods(Java Program ) Questions and Answers
Explanation:-
Answer: Option D. -> Compilation Errorsuper() call must be the first statement in a constructor.
Explanation:-
Answer: Option B. -> Won't compile because of line (5); constructor can't be finalOnly public, protected, private and default(no modifier) are legal when declaring constructors.
Explanation:-
Answer: Option D. -> Won't compile because of line (5), constructor can't be staticOnly public, protected, private and default (no access modifier) are legal while declaring constructors.
Explanation:-
Answer: Option B. -> At line 2, constructor calla constructor call (super() or this() ) must be the first statement inside a constructor.
No constructor calls are allowed inside a method.
static void Tester() is a method not a constructor.