โ Back to Classes
Question 4
Greeter Class
Greeter Class
Create a classGreeterwith a methodGreet(string name)that RETURNS the string "Hello, {name}!" (do not print inside the method). Do NOT write aMainmethod โ the tester constructs your class and prints the result. For Greet("Sam") the program prints: Hello, Sam!
Expected Output:
Hello, Sam!
Topics:
Classes
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.