No makeups will be considered without an official University excuse
The exam will consist of two parts:
Written part
50 minutes
Closed book, closed notes
You are allowed a one-sided 8 1/2 x 11 note sheet, hand-written
You are allowed a handheld calculator (not a cell phone or other mobile device)
Programming part
100 minutes
Open web, open notes
This will be like a mini-programming assignment
You may use code from your past programming assignments or from the course web site
You will submit your final program(s) into the Moodle Exam #0 dropbox
Your program will be graded on correctness, clarity (including comments), design, and efficiency
You will lose a substantial number of points if your program(s) do no compile or if they crash on typical inputs
You can use a lab machine or your own laptop
No communication with any non-staff members is allowed.
This includes all forms of real-world and electronic communication (talking, sign language, ESP, email, twitter, IRC, facebook, SMS, posting questions on forums, smoke signals, etc).
Material covered:
Lectures 0-7
Head First Java, all pages in schedule up to lecture 7
Programming assignments 0-3
Detailed topics:
Topics covered in CSCI 135, but with a heavy emphasis on the topics below:
Performance, difference between time and space
Empirical order of growth using doubling hypothesis
Common orders of growth: constant, linear, linearithmic (N log N), quadratic (N^2), exponential (2^N)
Performance profiling using the Stats class
Given timing data, determine most likely order of growth and constant factor
Extrapolate from existing performance data to larger input sizes
Recognize common code patterns and their order of growth
Multi-dimensional arrays, how to declare, instantiate, populate and use
Multi-dimensional arrays, determining length of the dimensions, ragged arrays
Polymorphism, objects related by inheritance in same container
Overriding methods of your parent, which method gets called if children and parent have same method
Difference between overloading and overridden methods
Concrete versus abstract classes. How do you tell if a class is abstract? Can you create an abstract class?
Abstract classes, fact that you can implement some methods and children can use
Using super() at start of a constructor to call parent's constructor
Using super.methodName() to call methods in a parent class
Using this() at start of a constructor to call another version of constructor in your own class
Handling exceptions using try-catch blocks
Multiple catch blocks, finally block
Ducking exceptions
Difference between a checked and unchecked exception
Writing text to a file using PrintWriter class
Reading and parsing text from a file using the File and Scanner classes
Difference between a static and instance methods, difference in how you call them
Java generics: defining a class that can hold any reference type
Java wrapper classes for primitive data types, auto-boxing, un-boxing
Java collections API: set of useful classes that hold things, e.g. ArrayList, HashMap, HashSet
List: holds a collection of objects and maintains ordering, duplicates can exist in list, e.g. ArrayList, LinkedList
Set: holds a collection of objects, no duplicates, e.g. HashSet
Map: maps keys to values, one key may map to multiple values, e.g. HashMap
Iterating over elements in a List, Set, or Map using enhanced for loop. Fact that you can't rely on order of iteration for some data types (e.g. HashMap, HashSet)
Hashing: mapping key to some integer bucket, storing items in separate buckets, why this is superior to storing in single list
Java interfaces: a list of abstract methods, only public static final constants allowed as instance variables
Fact that a class can implement 0+ interfaces but can only extend a single class
Difference between extending an abstract class and implementing an interface
Using instanceof to determine if an object in a polymorphic collection implements a certain interface
Using a cast to convert an object of a base type to something else
Using Java ArrayList, HashMap, and HashSet. Deciding which collections is most appropriate for a given problem.
Sorting collections that implement Comparable using Collections.sort() or Arrays.sort()
Making your own data types sortable by implementing the Comparable interface
Understand how enhanced for-loop is using Iterator object of a data type that implements the Iterable interface