Exam 2 Topics
- Module 5: Inheritance & Polymorphism
- Inheritance
- Base/Parent/Super Class
- Derived/Child/Sub Class
- Overriding Methods
- Verses overloading methods
- Calling the Base Class's Method
- super keyword
- The Object Class
- toString()
- equals( Object obj )
- UML (for inheritance)
- Polymorphism
- Benefits
- Class Relationships
- "is-a" Relationships
- "has-a" Relationships
- Abstract Classes
- When to make a class abstract
- Abstract methods
- UML (for abstract classes and methods)
- Interfaces
- When to use an Interface
- UML (for interfaces)
- Module 6: Arrays & Generics
- Arrays
- Declaring
- Creating space for an array (using new)
- Initialization
- Passing an array to a method
- Returning an array from a method
- Perfect Sized and Oversized Arrays
- Arrays are Stored as References
- Iterating through all elements
- Finding an element
- Removing and element
- Adding an element
- Two-Dimensional Arrays
- Multidimensional Arrays
- ArrayLists
- Advantages over arrays
- Relationship between size and capacity
- All of the above operations on arrays, applied to ArrayLists
- Vectors
- Differences between Vectors and ArrayLists
- Generics
- Generic Methods
- Bounded Generics
- Generic Classes
Module 7: Exception Handling
- Exception Handling
- Benefits over error handling
- Exception hierarchy
- try-catch-finally statements
- Minimum and maximum of each one
Module 8: File I/O
- File I/O
- Opening a file
- Writing to a file
- Reading from a file
- BufferedReader class (why to use it)
- Scanner class (when to use it and when to not use it)
- Closing a file
- File Exception Handling
Module 9: Recursion
- Recursion
- Definition
- Base case
- Typical Structure
- Four questions for constructing recursive solutions
- Iteration vs. Recursion
- Examples
- Factorial
- GCD
- Fibonacci Numbers
- Binary Search
- Towers of Hanoi