We will spend 2 weeks on this material.
Rectangle rec1 = new Rectangle(5,6,10,10);
System.out.println("rec1: " + rec1);
Rectangle rec2 = rec1;
rec1.setLocation(100,150);
System.out.println("rec1: " + rec1);
System.out.println("rec2: " + rec2);
rec1 = new Rectangle(50,60,20,20);
System.out.println("rec1: " + rec1);
System.out.println("rec2: " + rec2);
new
and a constructor
null
keyword and Null Pointer Exceptions
this
Object-oriented programming & Class Structure
... Class (user defined type) ... Object (instance of class) ... primitive type vs class type ... Attributes, Fields, or Member variables (data) ... Methods (actions) Method Structure: ... access specifier or modifier (e.g. public, private) ... method name ... method parameters ... pass by value vs pass by reference ... return type, return value ... variable scope: local vs global, shadowing Class Structure (more detail): ... Constructors, default constructor ... Public interface ... Private implementation, data hiding ... Mutator methods (setter) ... Accessor methods (getter) ... toString method
|
Object Creation and Use ... The keyword: new
... Sending a message, calling a method ... dot notation ... (formal) parameter vs argument (actual parameter) ... parameter passing ... Null pointer and the Null Pointer Exceptions ... Self reference keyword this
Code Design and Development ... UML Diagram ... Javadoc ... API (Application Programmer Interface) ... Encapsulation, modularization ... stepwise refinement ... reusability Testing and Debugging ... debugging & testing ... tracing code ... unit testing |