Cheatography
https://cheatography.com
JAVA Statment
If Statement
if ( expression ) {
statements
} else if ( expression ) {
statements
} else {
statements
}
While Loop
while ( expression ) {
statements
}
Do-While Loop
do {
statements
} while ( expression );
For Loop
for ( int i = 0; i < max; ++i) {
statements
}
Switch Statement
switch ( expression ) {
case value:
statements
break;
case value2:
statements
break;
default:
statements
}
Do....while
int count=0;
do{
System.out.print(count + " ");
count ++ ;
}while (count < 10);
Ans 0 1 2 3 4 5 6 7 8 9
|
|
|
Numbers
byte
8 bits
short
16 bits
int
32 bits
long
64 bits
boolean
( no bit just true/ false)
char
16 bit unicode
float
32 bit decimal
double
64 bit decimal |
Command
/n = new line
/t = tap
/" = "
/* = multiple
|
make class
Click src > main > new > Java class (then type the code)
public class Hello
|
|
|
Arrays / List
int[] ex1 = new int [3];
ex1[0]= 1;
ex2[1]= 2;
ex3[2]= 3;
|
String
String name = "bacon"
or
String name = 'Bacon'
|
Vocab
Java |
high level programming language that is readable by human called JVM ( Java Virtual Machine ). |
Compiler |
translater the program into machine language that can be executed directly on the computer. |
Executed |
Runing |
JVM |
another run program of Java. It referred to Java runtime. |
JDK (Java Development Kit) |
contains a complete class library of utilities that help you accomplish most common tasks. |
Java runtime |
a program that execute compiled Java byte codes. |
Java bytecodes |
he java complier translate your java program to be an intermediate level, which can be executed only by JVM. |
|
Created By
Metadata
Favourited By
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets
More Cheat Sheets by Sonnylnw MUIDS