โ Back to Printing
Question 19
Name and Age
Name and Age
Create a String variable with the value "Sarah" and an int variable with the value 22. Use one System.out.printf() statement to display: My name is Sarah and I am 22 years old Use %s for the String and %d for the int. Make sure to use the variables in the correct order within printf.
Expected Output:
My name is Sarah and I am 22 years old
Topics:
Printing
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท 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.