CSE 8A Lecture 3: Fall 2016: Lecture 3 Notes
Document Summary
Sequence of the code matters: java executes line per line. Each time new keyword is called -> new object created. Objects: classname variablename = new classname(parameterlist); After new -> code that creates constructor -> constructor: known as instances of class. Data types and assignment: declared type == assigned data, declaration and assignment on different lines is ok, all variables have an explicit type. Example: turtle maria = new turtle(), turtle jose = new turtle(), maria = jose; Maria points to same object as jose in computer"s memory. Added a nickname to the jose called maria.