class Human
{
private int age;
private String name;
public Human(){}
public Human(String name, int age)
{
this.name = name;
this.age = age;
}
public void display()
{
System.out.println(name + "----" + age);
}
}
class Student extends Human
{
int age = 98;
String name = "Irving";
}
public class ExtendsTest2
{
public static void main(String[] args)
{
Student s = new Student();
s.display();
}
}
|
|