U3L03 - object dot
This lesson drills what Trevor teaches in U3L03
Pre-requirements:
- You have performed each of previous drills to reach a top speed, and then repeated top speed 10x
- Follow this for all drills explainer
- Or this if you haven't even installed the drills yet installation
Summary of what is drilled
A Disciplined Approach? holds that these items should never again allow any confusion in your mind about this list of what Trevor covered in this lesson:
COVERED IN THE LESSON
- properties of object can be of the class or of Object
- yada.foo where yada is class and foo is property references property
- yafa.foo = "whatever" assigns a property
- syntax: must backslash a double quote to use it inside a String
System.out.println(objectReference)
prints the objects memory location by default which calls the object's toString() method;- to see how the java language itself is written, view TypeHierarchy and drill down inside the java code itself
- each instantiations of a class resolves to a different memory location on computer
- at this point the student can instantiate an object and set it's properties
Instructor Administered Test
- Create a new project
- Create a new package
- Create a new class with a new
public static void main
method - create the class for Dinosoar with the String properties of weight, color, length
- from the main method, declare and instantiate a Dinosoar object named fred
- from the main method, set the properties of fred using dot properties
- print the fred object in the console