Is there any compiler error in the below Java program?
Explanation: The main function calls paramaterless constructor, but there is only one constructor defined in class which takes two parameters.
Note that if we write our own constructor, then compiler doesn’t create default constructor in Java. This behavior is same as C++.
Quiz of this Question
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.