A constructor initializes an object.
It has the same name as the class and no return type.
class Student {
Student() {
System.out.println("Object created");
}
}A constructor initializes an object.
It has the same name as the class and no return type.
class Student {
Student() {
System.out.println("Object created");
}
}