... directs the user to take a specific action. We use method print
here rather than println
so that the user’s input appears on the same line as the prompt. Recall from Section 2.2 that identifiers starting with capital letters typically represent class names. Class System
is part of package java.lang
.
2.5.4 Declaring a Variable to Store an Integer and Obtaining an Integer from the Keyboard
The variable declaration statement in line 12
int number1; ...
Get Java How To Program, Late Objects, 11th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.