Let me explain
We know every class in java extends Object class.Lets say if you have a class Employee
public class Employee{
private String name;
// getters and setters
}
Then this class implicitly like this
public class Employee extends Object{
private String name;
// getters and setters
}
But if your class extends another class explicitly then
public class Employee extends BaseEmployee{
private String name;
// getters and setters
}
Then your Employee class doesn't extends Objects class.Instead your BaseEmployee will extends Object class.
Hope you get it ;)
No comments:
Post a Comment