About Java programs
About Java programs
Examples of legal identifiers: age, $salary, _value, __1_value In order to work with the Scanner class, you must first import
it into your code. There are two ways you can do this:
Examples of illegal identifiers : 123abc, -salary
JAVA KEYWORDS 1. If you only need to work with the java.util.Scanner class,
you can import the Scanner class directly.
Keywords are predefined identifiers reserved by Java for a specific 2. If you are working with other modules in the java.util
purpose. You cannot use keywords as names for your variables, library, you may want to import the full library.
classes, methods…etc. here is a list of the Java keywords. The following is the code for each of the above methods:
for loop
The for loop, like the previous loops, allows execution of the
same code a number of times.
Nested Loops