CS226 - Day 4 - Spring 2013 Fibonacci Sequence: 1 1 2 3 5 8 13 21 fibonacci.java has several versions of methods to compute the nth fibonacci number - constant, linear, and exponential Searching: linear vs. binary, see Searcher.java Java Wrapper classes - refresher (day5) ----------------------------- Reference types such as Boolean, Character, Integer... correspond to the primitive data types boolean, char, int. They are called "wrapper" classes because they wrap around the primitives, effectively creating class types for them. For example: Integer iref = new Integer(14); // create wrapper object int i = iref.intValue(); // get integer value out Autoboxing occurs when primitive types are promoted to wrapper types: Integer[] nums = {3, 4, null, 13, 7, null}; These classes are a mix of instance and static methods (such as Integer.parseInt(String)). If you haven't worked with them, check out the Java API for a few so you know what's available.