Refactoring (part 5)

  • 14
  • Locked
5.1. Create a template method. 5.1.1. Add a String getPosition() method to the Human class. It should return the string "Person". 5.1.2. Override this method in the Student and Teacher classes. The method should return "Student" and "Teacher", respectively.
You can't complete this task, because you're not signed in.
Comments (1)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
BlueJavaBanana
Level 37
3 October 2020, 11:06
Try simply...
System.out.println(getPosition() + ": " + name);