Keywords and Expression:
Program:
public class MainRunner {
public static void main(String[] args) {
// java keywords
// int int=1990;
// false,true,null
// Expression
// A mile equal to 1.609344 kilometers
double kilemeters = (100 * 1.609344);
int score = 65;// Expression
if (score < 100 && score > 40) { // Expression (....)
System.out.println();// Expression
}
}
}
Program:
public class MainRunner {
public static void main(String[] args) {
// java keywords
// int int=1990;
// false,true,null
// Expression
// A mile equal to 1.609344 kilometers
double kilemeters = (100 * 1.609344);
int score = 65;// Expression
if (score < 100 && score > 40) { // Expression (....)
System.out.println();// Expression
}
}
}
Statements:
Program;
public class Statements {
public static void main(String[] args) {
int myNumber = 90;
myNumber++;
myNumber--;
System.out.println("This is a test");
System.out.println("This is" + "another print " + " linse " + " example");
int var2 = 70;myNumber--;System.out.println("Same line demo....");
}
}
White-space:
White-space is a space in between some of your expression, your expression and so forth.
Example: int myNumber = 90;
Note: White-space can have one or more than one space will work fine.
Indentation:
Indentation is Indenting your code so that it's more readable.
Java Language Keywords
Here is a list of keywords in the Java programming language. You cannot use any of the following as identifiers in your programs. The keywords
const
and goto
are reserved, even though they are not currently used. true
, false
, and null
might seem like keywords, but they are actually literals; you cannot use them as identifiers in your programs.abstract | continue | for | new | switch |
assert *** | default | goto * | package | synchronized |
boolean | do | if | private | this |
break | double | implements | protected | throw |
byte | else | import | public | throws |
case | enum **** | instanceof | return | transient |
catch | extends | int | short | try |
char | final | interface | static | void |
class | finally | long | strictfp ** | volatile |
const * | float | native | super | while |
No comments:
Post a Comment