Midterm 1 Review

You are responsible to understand any information that

  • is required in a programming assignment that was due (whether or not you have done it yet),
  • was necessary to understand in order to complete a programming assignment (even if it was not mentioned in the instructions or any lecture),
  • was discussed in a lecture (whether or not it was recorded).

Terms:

  • JVM
  • JDK
  • compiler
  • bytecode
  • main
  • void
  • constructor
  • default constructors
  • import
  • primitive type
  • reference
  • reference type (a.k.a. class type)
  • Object
  • objects
  • class
  • casting
  • instance
  • inheritance
  • this
  • the stack (as opposed to "a stack")
  • the heap (as opposed to "a heap")
  • super
  • static (as pertains to both methods and variables)
  • local variables
  • member variables
  • class variables
  • scope
  • exceptions
  • try/catch blocks
  • throw
  • new
  • allocate
  • instance
  • instantiate
  • interface
  • implements
  • declare
  • initialize
  • extends
  • shadowing
  • polymorphism
  • abstract
  • collections
  • iterators
  • LinkedList
  • ArrayList
  • public / private / protected
  • ConcurrentModificationException
  • RuntimeException
  • NullPointerException
  • IllegalArgumentException
  • overriding
  • overloading
  • model-view-controller architecture
  • recursion
  • imperative programming
  • event-driven programming

Example questions:

Note: It is okay to ask questions in the class forum to help you study. However, please limit yourself to asking/answering one question per post. Please do not ask me or the grader to give you a private review session.

  • What does Java do that enables you to "write-once, run-anywhere"?
  • What are the two main categories of variable types in Java?
  • How are primitive types treated differently than reference types in Java?
  • Name 4 primitive types in Java.
  • Know the meanings of public, protected, and private and how they compare with each other.
  • Know how variables are initialized by default (including when they are local variables, instance variables, or class variables).
  • What is the difference between pass-by-reference and pass-by-value, and which does Java use?
  • What is method overloading and how it is accomplished? What is method overriding?
  • Understand the Java class hierarchy including knowing what is the superclass of all classes.
  • What are some of the methods available via that superclass?
  • Understand what is meant by event-driven, and how events are handled by Java GUIs.
  • Understand variable scopes, including those for local and instance variables, as well as shadowing.
  • Be able to write basic Java code, including a complete simple program.
  • Be able to read Java code and describe what it does.
  • Understand inheritance and know how to write classes which are sub-classes of another class.
  • Understand how constructors work, especially in relation to super-classes.
  • Know what interfaces are and how to use them.
  • Know what abstract methods are, and why they are useful. Be prepared to give an example.
  • Know what a V-table does. Know how polymorphism works "under the hood".
  • Know how to call the methods of a super-class from a sub-class.
  • Understand how static variables and methods are different from non-static.
  • Know how to use exception handling, including how to write a try-catch block.
  • Know how to read Java API documentation and use it to write code based on the objects provided by Java.
  • Know what collections and generic collections are.
  • Know how to use the following parts of a debugger: call-stack, watch variables, step over/in/out.
  • Understand where the debugger gets the information to present in its call stack and watch windows.
  • Be able to draw a diagram of memory given some code.