students
class Human
{
int eye;
void eat()
{
system.
out.
println("Every human needs eating");
}
}
class Student extends Human
{
int rollno;
void learn()
{
system.
out.
println("Every student must have to learn");
}
}
class Top10student extends Student
{
int ygpa;
void attendance()
{
system.
out.
println("Top 10 students must have 80% attendance in class");
}
}
class Test
{
public static void main
(string[] args
)
{
Top10student A=new Top10student();
A.eye=2;
A.eat();
A.rollno=34;
A.learn();
A.ygpa=9;
A.attendance();
}
}
Parsed in 0.021 seconds