Midterm Exam 1:
You are responsible for material covered in:
- Lectures
- Textbook readings, see topics below
- Labs: 1 through 6
- Programming assignment 1 and methods part of assignment 2
You do not need to memorize the operator precedence table or the methods
for the Java classes covered. We will provide a reference in the exam for
operator precedence and for select methods for these Java classes:
Math, Scanner, String and Random.
Sample Questions and Sample Exam
See the "Content" section (next to "Grades") of the course
Learn@UW page for sample questions and a sample exam from Fall 2012. A set of solution notes will be available for the Fall 2012 exam at 8am on Monday before the exam. See Learn@UW for those notes.
Topics
"Random Fact" sections are not included.
- Ch. 1: Introduction
algorithm and pseudocode, IDE, source code -> compiler, class files ->
virtual machine, class and main method, use of braces,
statements, parameters, string, System.out.println and
print, compile-time (syntax) vs. run-time (logic) errors,
exception, debugging and tracing
- Ch. 2: Fundamental Data Types
declaring and initializing variables, numeric data types (int,
double) and overflow, naming rules and conventions, reserved
words, comments, assignment operator (=) and statement, input
and Scanner class
, import statement, defining
constants with final, expression, operator, operand, arithmetic
operators (* / + - integer/ %), operator precedence,
inc/decrement operators (++ --), Math class, compound
assignment (+= -= *= /= %=), cast operator, String
class, concatentation, string input with next and
nextLine, escape sequences (\n \t \\), String
methods (such as length, charAt, substring),
char type, calling instance vs. calling static methods;
NOT INCLUDED: Special Topic 2.2
- Ch. 3: Decisions
conditions, boolean type and true/false
values, relational operators (< <= > >= == !=),
if statements (if, if-else, if-else-if forms and flowcharts),
switch statement (including break statement and
default case), boolean variables and operators (!
&& ||), truth tables, == vs. equals,
nested branches, dangling else problem, lazy evaluation,
DeMorgan's Law, input validation (hasNext), test cases (normal,
abnormal, boundaries)
NOT INCLUDED: Special Topics 3.1-3.2, 3.4-5
- Ch. 4: Loops
repetition idea, repeat while true, infinite loops, off-by-one errors,
while loop, count- vs. event-controlled loop, definite vs.
indefinite loop, for loop, scope of for loop counter,
do loop, post- vs. pre-test loop, user input validation,
sentinel value termination, algorithms (such as summing, average,
counting matches, comparing adjacent values), nested loops
- Ch. 5: Methods
call-execute-return sequence, declaring and calling (static)
methods, parameter passing and pass-by-value (argument values stored
in parameter variables), returning values and return statement,
void methods, call stack tracing, stepwise refinement and
incremental coding, stubs, local variables and variable scope;
NOT INCLUDED: 5.9 Recursive Methods
- Ch. 6.1, 6.3- 6.7: Arrays and Array Lists
declaring and initializing arrays, initial values list and filling
arrays, accessing elements and indexing from 0, length
property, bounds checking and ArrayIndexOutOfBoundsException,
array reference and memory diagrams for arrays, partially-filled arrays,
array algorithms (such as linear search, removing/inserting, copying
with Arrays.copyOf(), passing arrays to and returning arrays
from methods;
NOT INCLUDED: 6.2 The Enhanced for Loop, 6.7 Two-Dimensional
Arrays, 6.8 Array Lists, and Special Topics 6.1-6.3
- Random Class
seed, nextInt(), next(), generating random integers for a specified range
Midterm Exam 2:
You are responsible for material covered in:
- Lectures
- Textbook readings, see topics below
- Labs: 1 through 10
- Programming assignments 1, 2 and 3 (though we won't expect that you've finished 3)
You do not need to memorize methods for Java's API classes. We'll provide
a reference in the exam for a subset of methods for classes such as String,
Random, and ArrayList.
Sample Questions
See the "Content" section (next to "Grades") of the course
Learn@UW page for sample questions.
Topics
"Random Fact" sections are not included.
- Ch. 6.5 - 6.6+: Arrays and Array Lists
two-dimensional arrays,
ArrayLists, type parameter for generic class, wrapper classes
and auto-boxing, methods to add/remove/find/size/etc., copying with the
constructor, passing/returning, plus: arrays of objects,
partially filled arrays of objects and null, initiallizing the
array vs. the objects in the array;
NOT INCLUDED: 6.8.2 Using the Enhanced for Loop
- Ch. 8: Objects and Classes
object-oriented programming (OOP), (instantiable) class vs. object (aka
instance), creating objects using new, instance methods and
instance variables, default values for instance variables, interface
vs. implementation, public vs. private, encapsulation,
accessors and mutators, boolean methods, constructors, overloading,
driver (tester) class, object references and null, shared
references (aka aliases), passing/returning references, this
reference, calling instance methods, tracing OOP method calls and
memory diagrams, equals vs. ==, toString()
method, instance constants, class (static) constants, class
(static) variables, class (static) methods, packages
- Ch. 9.5: Inheritance and Interfaces
Object: the Cosmic Superclass, toString() and equals() methods. NOT INCLUDED: hashCode() method.
- variables (local, instance, class)
- constants (local, instance, class)
- chaining method calls
- garbage collection
- this() constructor call
Here's a link to a tutorial by Oracle about static vs instance members of Java classes: http://docs.oracle.com/javase/tutorial/java/javaOO/classvars.html
Final Exam:
The final exam is cumulative in two respects: new topics build
on previous ones and, while the written part of final exam emphasizes the
material since the second exam, the multiple choice part will be cumulative.
Review the topics listed for both midterm exams in addition to those listed
below. You are also responsible for the new material covered in:
- Lectures
- Textbook readings
- Labs: 11 through 14
- Programming assignments 3 and 4
Sample Questions
See the "Content" section (next to "Grades") of the course
Learn@UW page for sample questions.
Topics:
"Random Fact" sections are not included.
- Ch. 7: Input/Output and Exception Handling
text files,
file names - paths (absolute vs. relative) - directories (root vs. current, "." vs. ".."),
import java.io.*,
file output using PrintWriter,
file input using Scanner with File class,
FileNotFoundException and IOException,
close methods,
InputMismatchException,
command line arguments,
exception mechanism and messages,
exception classes and objects,
ArrayIndexOutOfBoundsException and IndexOutOfBoundsException,
NullPointerException,
ArithmeticException,
throwing exceptions (throw statement),
catching exceptions (try-catch statement),
exception handlers,
finally clause,
exception class hierarchy,
checked vs. unchecked exceptions,
checked exceptions and throws clause,
defining your own exceptions with extends clause,
NOT INCLUDED:
7.2.9 Formatting Output and Special Topics 7.1 to 7.5
- Ch. 9.5-9.6: Inheritance and Interfaces
Object class,
instanceof operator and casting,
toString and equals,
defining and implementing an interface,
implements clause,
Comparable interface,
compareTo method,
NOT INCLUDED: Special Topics 9.8 and 9.9
Last updated: 2/28/2013 ©2012-13 Deb Deppeler, ©2010-12 Jim Skrentny (cgi by Dalibor Zelený)