Paste Search Dynamic
Recent pastes
students
  1. class Human
  2. {
  3.    int eye;
  4.    void eat()
  5.    {
  6.      system.out.println("Every human needs eating");
  7.      }
  8.  }
  9.  
  10. class Student extends Human
  11. {
  12.   int rollno;
  13.   void learn()
  14.    {
  15.       system.out.println("Every student must have to learn");
  16.  
  17.      }
  18. }
  19.  
  20. class Top10student extends Student
  21. {
  22.   int ygpa;
  23.   void attendance()
  24.    {
  25.       system.out.println("Top 10 students must have 80% attendance in class");
  26.      }
  27. }
  28.  
  29. class Test
  30. {
  31.   public static void main(string[] args)
  32.    {  
  33.       Top10student A=new Top10student();
  34.       A.eye=2;
  35.       A.eat();
  36.       A.rollno=34;
  37.       A.learn();
  38.       A.ygpa=9;
  39.       A.attendance();
  40.       system.out.println(A.eye);
  41.       system.out.println(A.rollno);
  42.       system.out.println(A.ygpa);
  43.  
  44.          }
  45. }
  46.  
Parsed in 0.021 seconds