Jan-10-2021, 02:24 PM
Yeah, the reason why we have to use double underscores is mainly that the teacher requires them since he is out on quarantine and the teacher requires the toString method to display it like.
Write a student class that has four properties (private variables): date of birth, name, ID number, and grade level. Write getters and setters for each property. Finally, write a toString() method that displays the student in the following format:
Name
ID number
Date of Birth
Grade Level
Output:Name
ID Number
DOB
Graduation date
This is what the teacher told usWrite a student class that has four properties (private variables): date of birth, name, ID number, and grade level. Write getters and setters for each property. Finally, write a toString() method that displays the student in the following format:
Name
ID number
Date of Birth
Grade Level