โ Back to Classes
Question 435
Name Formatter Class
Name Formatter Class
Create a classNameCardwhose constructor stores a first and last name, and aFormatted()method that returns the name as "<last>, <first>". Do not write aMainmethod. Fornew NameCard("Alan", "Turing")the program prints: Turing, Alan
Expected Output:
Turing, Alan
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.