|
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
|
|
Class
|
a blue print for an object
|
|
Object
|
a instance of a class
|
|
Package
|
Organization of class
|
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);
}
}
|
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.
|
|
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
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.