CIS 3115
Modern Programming Techniques
Exam #2 Topic List
The Structure of the Exam
- For all topics, you should be able to trace, analyze, and write Java code.
- Questions will for the most part consist of:
- presenting you with a piece of code and asking you what is output — or what the value of one or more variables
are — once the code is executed
- presenting you with a problem decription and asking you to write the corresponding code
- asking you what is wrong with a piece of code and/or asking you to repair it
- presenting you with a piece of code and asking you to trace the value of one or more variables
as the code is executed
- Although you will not be asked for definitions of terms, you should know them as they will be used in the text of the questions.
- A substantial portion of the exam will be based on the assigned exercises/labs and lecture code.
- While the book is a good supplement, you are only responsible for topics and material in the lecture notes and
the CodeLab exercises / labs / projects. These are a great way for you to prepare yourself for the exam.
The exam is cumulative, but focuses on Lectures 3-5 (Exception-Handling, Interfaces, Class Inheritance). Here is a detailed breakdown of the topics
Exception Handling>
- Alternatives to exception-handling: guardian methods, overloaded (trailer) return values, result objects
- Throwing, catching exceptions
- try/catch blocks
Interfaces
- Syntax, semantics, and purpose of an interface
- Implementing classes
- programming to the interface vs programming to the implementation/class
- Coding interface-level 'demo' apps
- Interface inheritance
Class Inheritance
- Independent implementation vs composition vs inheritance
- Superclasses (parent) /subclasses (child)
- Syntax, semantics, and purpose of inheritance
- protected data access
- up/downcasting
- overriding methods
- vs overloading (compile-time polymorphism)
- superclass initialization
Polymorphism
- Rule of Polymorphism: method resolution is based on the (runtime/dynamic) type of the object and not the
(static/compile-time) type of the receiver reference variable.
Abstract Classes and Methods
- Syntax, semantics, and purpose of an abstract class
- Skeletal class implementing part of an interface
And of course all CodeLab exercises, Labs, and Lecture code