CJCoding With Joseph

Getter Method

The Student class stores a private field name set by the constructor. Add a public method GetName that returns the value of name. The tester prints it. Do NOT write a Main method.

For new Student("Ada") the program prints:
Ada

Expected Output:

Ada
Topics:
Encapsulation
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cw, cr, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.