Cheatography
https://cheatography.com
Numbers
Byte mybyte = 2; |
8bits / 1byte |
Short myshort = 200; |
16bits / 2byte |
Int my int = 1000000; |
32bits / 4byte |
Long mylong = 999999 |
64bits / 8byte |
Double my double = 1.5; |
64bits / 8byte |
Float myfloat = 1.5; |
32bits / 4byte |
|
|
Object
Class |
a blue print for an object |
Object |
a instance of a class |
Package |
Organization of class |
Swap
Public class Main {
public static void swap(int[] list, int e1, int e2){
int temp;
temp = list[e1];
temp = list[e2];
list[e2] = list[e1];
list[e1] = temp;
for (int i : list){
System.out.println(i);
}
}
public static void main(String[] args) {
int[] mylist = new int[]{1,2,3,4,5};
swap(mylist, 1, 2);
}
}
|
|
|
Vocab
Program Execution |
Running program |
Java Bytecodes |
the instruction set of the Java virtual machine. |
Java Virtual Machine (JVM) |
an abstract computing machine that enables a computer to run a Java program. |
Function
System.out.print() |
print |
System.out.println() |
print in the same line |
public static |
modifier |
int |
return type |
charAt() |
Returns the character at the specified index. |
Booleans. |
True of False |
|
Created By
Metadata
Favourited By
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets
More Cheat Sheets by Sonnylnw MUIDS