Week 02: Object-Oriented Programming
-
After this unit, students should
- understand the drawback of breaking the abstraction barrier.
- understand the concept of information hiding to enforce the abstraction barrier.
- understand how Java uses access modifiers to enforce information hiding.
- understand what is a constructor and how to write one in Java.
-
After this unit, students should
- understand what accessor and mutator are used for, and why not to use them.
- understand the principle of "Tell, Don't Ask".
-
After this unit, students should
- understand the difference between instance fields and class fields.
- understand the meaning of keywords
finalandstaticin the context of a field. - be able to define and use a class field.
- be able to use
importto access classes from the Java standard libraries.
-
After this unit, students should
- understand the differences between instance methods and class methods.
- be able to define and use a class method.
- know that the
mainmethod is the entry point to a Java program. - know the modifiers and parameters required for a
mainmethod.
-
After this unit, students should
- understand how to compose a new class from existing classes using composition.
- understand how composition models the HAS-A relationship.
- understand how sharing reference values in composed objects could lead to surprising results.
-
After this unit, students should
- understand when memory is allocated/deallocated from the heap and from the stack.
- understand the concept of call stack in JVM.
-
After this unit, students should
- understand inheritance as a mechanism to extend existing code.
- understand how inheritance models the IS-A relationship.
- know how to use the
extendskeyword for inheritance. - understand inheritance as a subtype.
- be able to determine the run-time type and compile-time type of a variable.
-
After this unit, students should
- be aware that every class inherits from
Object. - be familiar with the
equalsandtoStringmethods. - understand what constitutes a method signature.
- understand method overriding.
- appreciate the power of method overriding.
- understand what Java annotations are for, and know when to use
@Override. - be exposed to the
Stringclass and its associated methods, especially the+operator.
- be aware that every class inherits from