Class Student

  • All Implemented Interfaces:
    Comparable<Person>

    public class Student
    extends Person
    Class for special person student. Students additionally do some study.
    Author:
    Herbert Praehofer
    • Field Detail

      • study

        private Study study
        The study of the student
    • Constructor Detail

      • Student

        public Student​(String name,
                       int age,
                       Study study)
        Constructor initializing name, age and study.
        Parameters:
        name - the name of the student
        age - the age of the professor
        study - the study of the student
      • Student

        public Student​(String name,
                       int age)
        Constructor initializing name and age.
        Parameters:
        name - the name of the student
        age - the age of the student
      • Student

        public Student​(String name)
        Constructor initializing name.
        Parameters:
        name - the name of the student
    • Method Detail

      • getStudy

        public Study getStudy()
        Returns the study of this student.
        Returns:
        the study
      • setStudy

        public void setStudy​(Study study)
        Sets the study of this student.
        Parameters:
        study - the new study
      • toString

        public String toString()
        Returns a string representation of this student.
        Overrides:
        toString in class Person
        Returns:
        the string representation