CJCoding With Joseph
15free / daySign inCreate account

Override toString in Student

A Person class is provided with a name field. Complete the Student class that extends Person.

Requirements:
1. Student has an additional int grade field.
2. The constructor takes name and grade, calling super(name) for the name.
3. Override toString() to return the format: "<name> - Grade <grade>".

Do NOT write a main method.

Expected Output:

Alice - Grade 10

= newline. The output ends with a newline — print one after the last line.

Hints3 available
Topics:
InheritanceClasses
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · 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.