Cheatography
https://cheatography.com
Data Types
byte |
8 bits |
-27 to 27 - 1 |
short |
16 bits |
-215 to 215 - 1 |
int |
32 bits |
-231 to 231 - 1 |
long |
64 bits |
-263 to 263 - 1 |
boolean |
true \ false |
char |
16 bit unicode |
-215 to 215 - 1 |
float |
32 bit decimal |
-231 to 231 - 1 |
double |
64 bit decimal |
-263 to 263 - 1 |
Encapsulation
public |
user can see |
private |
hide from user |
Swap
int temp = e1;
e1 = e2;
e2 = temp;
|
While loop
while(condition) {
//codes
}
|
For Loop Array
string word = "Hello";
for (char c: word.toCharArray()){
system.out.println()
...
}
|
Class
public class ABCD {
public A () {
//codes
}
public void B() {
//codes
}
}
*public A = default, run automatic
*public void B = need call
|
|
|
Commands
\n |
new line |
\t |
tab |
\" |
" |
\' |
' |
\\ |
\ |
Do - While loop
do {
//codes
} while (condition);
|
For Loop List
int mylist = {100,200,300,400};
for(int item = 0; item< mylist.length; iterm++){
//codes
}
for(int item mylist) {
//codes
}
|
Abbreviation
JVM |
JAVA Virtual Machine |
JRE |
JAVA Runtime Environment |
JDK |
JAVA Development Kit |
bytecode |
intermediate level long |
compiler |
JAVA -> Bytecode |
Java Runtime |
bytecode -> machine |
native compiler |
directly to machine |
Array
int[] mylist = new int[2]
mylist[0] = 100;
mylist[1] = 200;
int[] mylist = {100, 200}
|
|
Created By
Metadata
Favourited By
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets
More Cheat Sheets by pca221