โ Back to Interfaces
Question 599
Interface With a Read-Only Property
Interface With a Read-Only Property
The interfaceINameddeclares a read-only propertystring Name { get; }. TheDogclass already stores a name in_name. Add theNameproperty so it returns_name. Do NOT write aMainmethod. For aDogcreated with"Rex"the program prints: Rex
Expected Output:
Rex
Topics:
Interfaces
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.