www.descriptor.com/courses/java-p1-seattle-1-2014 if ( ....... ); System.out.println(x); System.out.println(y); if(Character.toLowerCase(key) == 'q' ) { System.exit(0); } else { System.out.println(key); } int i = 10; while(i <= 100) { System.out.print(i); i = i + 5; } for(int i = 10; i <= 100; i + 5) System.out.println(i); public class Dog { private int weight; private String color; public void eat() { weight++; } public void bark(int volume) { } } public class TestDog { public static void main(String[] args) { Dog lassie = new Dog(); Dog fido = new Dog(); lassie.eat(); fido.bark(8); eat(); } } public class Policy { private String name; private int amount; private boolean isSmoker; public boolean rate() { if(amount < 100000 && isSmoker == false) return true; else return false; } } public class TestPolicy { public static void main(String[] args) { Policy policy = new Policy(); System.out.println(policy.rate()); } } public class Test { public static void main(String[] args) { Person p1 = new Person(); Person p2 = new Person(); p1.setAge(12); p2.setAge(42); int a = p1.method1(2); int b = p2.method1(2); method1(); } Methods m = new Methods(); m.method1(); int a = m.method2(1); double b = m.method3(4, 17); Random r = new Random(); r.setSeed(1); long myvar = r.nextLong(); public class Claim { private Date date; private int number; private double amount; public Claim(int num, double amt) { number = num; amount = amt; } public Claim(int num, double amt, Date dt) { number = num; amount = amt; date = dt; } } public class TestClaim { public static void main(String[] args) { Claim c1 = new Claim(2, 200.0); Claim c3 = new Claim(45, 55.66, new Date()); } } File f = File.createTempFile("myfile", null); www.descriptor.com/courses/java-p1-seattle-1-2014 for(int x = 100; x >= 0; x-=5) { System.out.println(x); } double x = Math.sqrt(3.2434); try { Socket s = new Socket("google.com", 80); } catch(UnknownHostException e) { System.out.println("bad host"); } catch(IOException e) { System.println("What the heck?"); }