// DrJava saved history v2 // Today we looked at writing subclasses using the "extends" keyword // We also looked at overriding methods as well as the "instanceof" keyword // We created Student as the class which we extended with subclasses // AthleticStudent and LazierStudent. AthleticStudent andy = new AthleticStudent("Andy", 123, "cricket"); andy.toString() AthleticStudent faisal = new AthleticStudent("Faisal", 456, "curling"); faisal.toString() AthleticStudent faisal = new AthleticStudent("Faisal", 456, "curling"); AthleticStudent.type(faisal) Student faye = new Student("faye", 993); AthleticStudent.type(faye) LazierStudent angie = new LazierStudent("Angie", 534, "Olives"); angie.toString() AthleticStudent.type(angie) LazierStudent angie = new LazierStudent("Angie", 534, "Olives"); LazierStudent.isStudent(angie) AthleticStudent faisal = new AthleticStudent("Faisal", 456, "curling"); LazierStudent.isStudent(faisal) LazierStudent angie = new LazierStudent("Angie", 534, "Olives"); LazierStudent.isAthletic(angie) AthleticStudent faisal = new AthleticStudent("Faisal", 456, "curling"); // note that when we checked whether faisal is a Student it returned true // and that it also returns true when we check to see if he is an athletic student. LazierStudent.isAthletic(faisal)