Open Shrikiran11 opened 2 years ago
class Employee {
int id = 123; final Employee() { id = id - 2; }
}
class Company { public static void main(String[] args) { Employee em = new Employee(); } } //Exception in thread "main" java.lang.Error: //Illegal modifier for the constructor in type Employee; only,protected & private are permitted
//Exception in thread "main" java.lang.Error: //Illegal modifier for the constructor in type Employee; only,public protected & private are permitted
class Employee {
}
class Company { public static void main(String[] args) { Employee em = new Employee(); } } //Exception in thread "main" java.lang.Error: //Illegal modifier for the constructor in type Employee; only,protected & private are permitted