Student.java

mail@pastecode.io avatar
unknown
plain_text
3 years ago
334 B
1
Indexable
Never
public class Student extends Person{

    private String subject;

     

    public Student(String name, int age, String subject){

      super(name, age);

      this.subject = subject;

    }

     

    public void printInfo(){

      System.out.print(super.getName() + super.getAge() + subject);

    }

  }