โ Back to Classes
Question 192
Override toString in Student
Override toString in Student
APersonclass is provided with anamefield. Complete theStudentclass that extendsPerson. Requirements: 1.Studenthas an additionalint gradefield. 2. The constructor takesnameandgrade, callingsuper(name)for the name. 3. OverridetoString()to return the format:"<name> - Grade <grade>". Do NOT write a main method.
Expected Output:
Alice - Grade 10
Topics:
InheritanceClasses
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (sysout, psvm, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.