Last modified:
December 13, 2025
Topics
Preparation for Final Exam
- Java programming language
- Java is architecture neutral (lec. 2)
- Compiling and execution process (lec. 2)
- Use javac to compile a source code to bytecode; if syntax error, no bytecode is produced
- Use java to interpret byte code
- Primitive data types
- Primitive data types (byte/short/int/long, float/double, char, boolean) [byte/short/int/long/float/double in lec. 2; boolean in lec. 6; char in lec. 3]
- Arithmetic/Boolean expressions [lec. 3 on basic operators such as +, -, * , /, %; lec. 4 on assignment operators; PS5 Cashier on using %; lec. 6/7 on Boolean operators; lec. 4/5 on char operators]
- Data conversions (automatic promotion, cast) [lec. 4; lec. 7 on char/int conversion]
- Variables
- Variable scope; class-scope variables [lec. 4; lec. 6; PS4 Animation program structures]
- Constants
- Assignment operators
- Value semantics of primitive variables
- Flow of control
- Boolean expressions (||, !, &&, == vs =); Boolean variables; Boolean Zen [lec. 6/7]
- Conditional statements, if/else, nested if/else (e.g., Grading curve [lec. 7])
- Three loop statements: for, while, do/while
- Common loop patterns:
- for loops, in particular, mapping from loop variable to pattern (e.g., DrawRocket)
- Cumulative loops (MonteCarloPi, Letter/Grade Histogram)
- Search and file processing loops [lec. 9]
- Methods
- Why methods
- Method definition, in particular overloading, and invocation
- Method parameter passing
- Method variable scope
- Using method with checked exception, also declares throws or use try/catch
- Arrays
- Declaration and instantiation of arrays with a list (e.g., month to month name Final Example)
- Basic usage of arrays: as parameters of methods, array elements as counters
- Uses predefined Java classes
- What is package and why import?
- Graphics: StdDraw methods (what is and how to set the setX/Yscale, line, rectangle, text), basic idea of animations (what is double buffer, what does show do)
- Text input: Scanner, nextInt, nextDouble, hasNext, hasNextInt, ...; Integer.parseInt, Double.parseDouble; what is redirect? How to use Scanner with System.in, with a File, or with a String.
- Text output: print, println, printf, format
- Text processing: common methods such as print, println, printf, format, equals, equals vs ==, substring, indexOf,
- Basic Math methods: round (what does it return; why need (int) to cast Math.round(1.0)), random (what does it return)
Some FAQs
We update here for common questions that we receive on Final Exam. Please reload/refresh to make sure that you have the newest
copy. Please let us know your questions.
- Topics to be covered
- Q: Should we become familiar with making graphics and animation?
A: If you feel comfortable with PSets in graphics,
you have all that we need to prepare for the
exam.
- General
- Q: Do you have any suggestions on preparing for
the Final Exam?
A: If you feel comfortable with all of the assignments up
to PS6, you should do well. The practice
questions at the end of each chapter can be helpful. The
https://horstmann.com/codecheck/index.html
site appears to be quite helpful as well.
-
Q: What is the distribution of question types for this exam?
A: The exam consists of four main sections:
- Short Answer: 6 questions, totaling 50 points.
- Writing Methods: 2 questions, totaling 20 points.
- Program Reading: 5 questions, totaling 30 points.
- Bonus: Two options (choose one), worth 10 points.
-
Q: What is the format of the exam?
A: Written exam.