Search This Blog

Sunday, July 19, 2020

Keywords and Expression

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
}

}
}


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. truefalse, and null might seem like keywords, but they are actually literals; you cannot use them as identifiers in your programs.
abstractcontinuefornewswitch
assert***defaultgoto*packagesynchronized
booleandoifprivatethis
breakdoubleimplementsprotectedthrow
byteelseimportpublicthrows
caseenum****instanceofreturntransient
catchextendsintshorttry
charfinalinterfacestaticvoid
classfinallylongstrictfp**volatile
const*floatnativesuperwhile

No comments:

Post a Comment