// ------- IMPORTS --------------------- import java.util.LinkedList; import java.util.HashMap; // ------- CLASSES AND INTERFACES ------ class A extends B implements I { ... } interface I { ... } // ---------- STRINGS ------------------- "kathi".length(); "kathi".equals("gompei"); // ---------- LISTS -------------------- LinkedList myList; // add item to the end of a list, returns void myList.add("hi"); // add item to the beginning of a list, returns void myList.addFirst("hi"); // check whether item is in a list, returns boolean boolean b = myList.contains("hi"); // get item from a specific position in a list, first position is 0 String s = myList.get(3); // get the length of the list int length = myList.size(); // ---------- HASHMAPS ------------------ HashMap myHM; // put item into a hashmap, returns previous value or null String prevVal = myHM.put("kathi", 130); // get item from hashmap, returns null if no value for key String value = myHM.get("kathi"); // --------- FOR ------------------------ for (TYPE VAR : LIST) { ... } for (VAR = INIT ; WHEN-TO-STOP ; UPDATE-VAR) { ... } // --------- IF -------------------------- if (TEST) { ... } else { ... } // ------- BOOLEAN OPERATORS -------------- b1 && b1 // and b1 || b2 // or !b1 // not // ------- NULL ---------------------------- Assign to a variable if need a way to say "no information"