Review for Exam1 221

 


•         Java review

•                     Most of this was from looking a code

•                     PhoneDirectory code was almost like the DVD code

 

•                     How to write a class for a single object

•                     PDEntry

•                     DVDEntry

•                     constructors

•                     mutators and accessors

•                     toString method so object could be output

•                     How to write a class for an array of objects

•                     how to declare a constant

•                     how to read from a file and write to a file

•                     how to add another object to the array

•                     how to find the data of an item, given the key

•                     how to throw and catch exceptions

•                     when to use private methods instead of public

•                     How to access components of an object stored in an array of those objects

•                     How to write a client for the array of objects class

•                     Static methods, when to use

•                     How to use the array of objects as an argument for a method

•                     Using a menu to let the user choose an option

•                     How to stub in un implemented methods

 

Exceptions

•         Know something about the exception hierarchy

•         Know the difference between checked and unchecked exceptions

•         Know what the stack trace is

•         Know how exceptions that are not caught are propagated back to the calling method

•         Know when to use a throws clause

     

Big-O notation

•   We did not look at the formal definition

•   Know that Big-O is a way to relate execution timeT(n) with input size n

•   Know the common growth rates, and their relative order      

     

•         Inheritance

•                     Why is it important?

•                     How does it work?

•                     Superclass is more general, subclass is more specialized

•                     Inheritance is used with an is-a relationship, not a has-a relationship

•                     Know the difference between the protected access specifier and private

•                     Understand about constructor chaining (call the superclass with the keyword super)

•                     Know what overriding is and how it works

•                     Know what polymorphism is, and how it can be implemented

•                     Understand that a reference variable might refer to an object whose type is a subtype

•                     So the reference variable and objected referred to may not be the same type

•                     The constructor called determines the object’s type

•                     The variable declaration determines the reference variable’s type

     

An abstract class is a class which has one or more abstract methods

•                             An abstract method is a method that is not implemented

•                             Abstract classes may not be instantiated, but can have instance variables and implemented methods           

 

The Object class

•    All other classes are derived from the Object superclass

•     Useful methods include Object clone( ), boolean equals(Object) and String toString

•     When these methods are overriden the the Object type must be downcast to the type you are working with

 

•         Cloning

•         Visibility