Show Menu
Cheatography

Java cheat sheet Cheat Sheet by

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
Organi­zation 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 instru­ction 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.ou­t.p­rint()
print
System.ou­t.p­rin­tln()
print in the same line
public static
modifier
int
return type
charAt()
Returns the character at the specified index.
Booleans.
True of False
   
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Selenium WebDriver Cheat Sheet Cheat Sheet
          Cypressio Cheat Sheet
          ISTQB Test Automation Engineering Cheat Sheet

          More Cheat Sheets by Sonnylnw MUIDS