java programming Cheat Sheet
by ppinkyy via cheatography.com/25758/cs/8968/
data types object
byte 8 bits class a blue print for an object
shoryt 16 bits object an instance of a class
int 32 bits package Organization of a class
long 64 bits
Vocab
boolean bit
char 16 bits unicode Program Running program
Execution
float 32 bits decimal
Java Bytecodes the instruction set of the Java virtual machine.
double 64 bits decimal
Java Virtual an abstract computing machine that enables a
Machine (JVM) computer to run a Java program.
Function
System.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
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);
}
}
By ppinkyy Published 6th September, 2016. Sponsored by CrosswordCheats.com
cheatography.com/ppinkyy/ Last updated 6th September, 2016. Learn to solve cryptic crosswords!
Page 1 of 1. http://crosswordcheats.com