Show Menu
Cheatography

Java Intro Software Cheat Sheet (DRAFT) by

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Swap Algorithm List

    public static void swap(int[] list, int e1, int e2){

        int temp;
        temp = list[e1];

        list[e1] = list[e2];

        list[e2] = temp;


        for (int i : list){ //this is called a foreach loop or an enhanced for loop
            System.out.println(i);
        }
    }

Data Types

byte
8 bits
short
16 bits
int
32 bits
long
64 bits
boolean
bit
char
16 bit unicode
float
32 bit decimal
double
64 bit decimal