Java - Constructors
Identify the error in the following class with overloaded constructors:
class Calculator {
Calculator() { System.out.println("Default constructor"); }
Calculator() { System.out.println("Second constructor"); }
}Identify the error in the following class with overloaded constructors:
class Calculator {
Calculator() { System.out.println("Default constructor"); }
Calculator() { System.out.println("Second constructor"); }
}15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions