Default Constructor example - Core Java
Q. The following program is an example for?
class Student{
int id;
String name;
void display(){System.out.println(id+" "+name);}
public static void main(String args[]){
Student s1=new Student();
Student s2=new Student();
s1.display();
s2.display();
}
} - Published on 20 Jul 15a. Parameterized constructor
b. Default Constructor
c. Overloading Constructor
d. None of the above
ANSWER: Default Constructor