CIS 121 April 24, 2000
Our Final Exam will be a common exam next Tuesday May 2, 2000 from 3:30 pm
- 5:30 pm. On Wednesday you will told in what room your exam will he held.
We have finished Module 5 and today and Wednesday will be spent reviewing topics
for the Final. On Thursday you may use the lab meeting to finish up your
program.
Before we go back to the beginning, let us recap the topics we have
covered in Module 5.
- Stack - A stack is a LIFO data structure, that is last element in is
the first element out.
- There are several intrinsic operations related to a stack: push (add
an element to the stack), pop (remove an element from the stack),
peek (examine the element on top of the stack without removing it),
isEmpty (determine whether or not the stack is empty), and search (find
the position of an element in the stack).
- These operations are implemented for us in the JDK using Vectors.
- A Vector unlike an array can grow dynamically. An array's size must
be declared up front.
- Unlike an array, a vector can only hold object references, so we must
keep track of what we place in the vector so that when we remove it we
can cast it back to the appropriate object type.
- Queue - A queue is a FIFO data structure, that is first element in
is the first element out.
- There are many natural examples of a queue such as a queue of print jobs
or a queue of threads.
- There are a few intrinsic operations related to a queue: enque (add
to the queue), deque (remove an element from the queue), and isEmpty (determine
whether or not the queue is empty).
- A queue can be implemented in different ways one of them being a linked
list.
- A list is an abstract data type which we can implement in Java.
- In languages such as C++ there are variable types called pointers which
contain the address of an area of memory.
- Java does not contain support of pointers. However, Java does have
support for self-referential structures. These are class definitions which
contain a variable whose type is the class.
- There are several differences between arrays and linked lists. One of
them is that the size of an array must be declared when it is created whereas
a linked list can grow dynamically as long as there is available memory.
- We discussed several methods related to linked list such as insert,
delete and traverse.
- We also discussed the Big O notation which measures the complexity
of algorithms. That is, in the long run how long will the algorithm take
to complete based on the number of elements in the construct we are dealing
with.
Review for the Final Exam - Part I
What is the syntax of the header of a class definition?
What are formal parameters?
What are actual parameters?
What are instance variables?
What are instance methods?
What are class variables?
What are class methods?
How do we distinguish between instance variables/methods and class variables/methods
What is a constructor?
What is the purpose of a constructor?
What are the four choices for access control keyword?
What is a default package?
When do we use the keyword this?
What is the method toString used for?
What is a default constructor?
When is a default constructor used?
What is method overloading?
How many constructors can a class have?
What is a local variable?
What is an ADT?
What is encapsulation?
What is information hiding?
Explain where variables and methods are available when using the
four access control keywords
What are the three aspects of good code design and explain each? (cohesion,
competent/complete classes, and loose coupling)
What are the rules for creating named packages?
What are the rules for using the default package?
How does the compiler and interpreter use the environment variable CLASSPATH?
What is the finalize method?
What is garbage?
What is garbage collection?
How does garbage collection happen?
What are the seven major components in a class definition?
What does the StreamTokenizer do?
Explain how StreamTokenizer works
In what Java package is StreamTokenizer located?
What is a deprecated feature?
What is the Java keyword used to create an object?
How does it work?
What is a static initializer?
What does a static initializer do?
What is the syntax of a static initializer?
What is an inner class?
When do we use a class variable?
When do we use an intance variable?
When do we use a local variable?
What is inheritance?
What type of inheritance does Java support?
What keyword is used to implement inheritance?
What is the class hierarchy?
What is the top level of the class hierarchy?
How does Java deal with constructors when we use inheritance?
What does the super statement do in a subclass constructor?
What is the rule for using the super statement in a subclass constructor?
What happens if there is no super statement in a subclass constructor?
How do we override methods?
What are interfaces?
What is the Object class?
How can we use the Object class in our methods?
What are concrete methods?
What are concrete classes?
What are abstract methods?
What are abstract classes?
How do we use features from the parent class in a subclass?
What is polymorphism?
What is an example of polymorphism?
What does the boolean method equals do?
How do we use the equals method?
What are the four ways to obtain packages to solve real problems
in Java and what is the order of preference?
When using the extends clause to implement inheritance, what are the
four ways of describing the relationship between the classes involved?
What does implementing interfaces allow us to do with unrelated classes?
What are two examples of interfaces?
What is a clone?