Working with Objects
Working with Objects: Working with Objects: an overview, What is an Object, Defining an Object, Writing the Class in Java, What is a Constructor.
Updated
- Working with Objects: an overview (Novice): Object-oriented programming models a program on real things: objects that each have a job to do.
- What is an Object (Novice): Every object has a responsibility, and modeling a program starts with listing the objects and what each one is for.
- Defining an Object (Apprentice): An object's responsibilities split into what it knows (its variables) and what it can do (its methods), and a class is the blueprint that describes both.
- Writing the Class in Java (Apprentice): Turn a class design into Java with private variables, getters and setters, and methods, then create an object from it with new.
- What is a Constructor (Apprentice): A constructor gives a new object the starting values it needs, and `this` tells the object's own variable apart from a parameter with the same name.