Cheatography
https://cheatography.com
data typesbyte | 8 bits | shoryt | 16 bits | int | 32 bits | long | 64 bits | boolean | bit | char | 16 bits unicode | float | 32 bits decimal | double | 64 bits decimal |
FunctionSystem.out.print() | print in the same line | System.out.println() | print in the different line | public static | modifier | charAT() | Return the character at the specified index | Boolean | True or False |
SwapPublic 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);
}
}
|
| | objectclass | a blue print for an object | object | an instance of a class | package | Organization of a class |
VocabProgram 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. |
|
Help Us Go Positive!
We offset our carbon usage with Ecologi. Click the link below to help us!
Created By
Metadata
Favourited By
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets
More Cheat Sheets by ppinkyy