Learning objectives
Write void and non-void methods with correct headers and return statements, and explain that a return executed inside a loop or an if statement ends the method immediately
Explain that a primitive argument is copied into its parameter while an object argument passes a copy of the reference, so a method can change the object the caller sees but can never make the caller refer to a different object
Explain that returning an object hands back a reference to that same object rather than a copy, and that a method may use the private data of a parameter whose type is its own class
Declare and use static variables and static methods, reach a public static variable through the class name, mark a constant final, and explain why a static method cannot use instance variables or this without an object
Distinguish local variables, parameters and instance variables by their scope and lifetime, and explain how a local variable or parameter with the same name hides an instance variable
Use the keyword this to refer to the current object, both to reach an instance variable hidden by a parameter and to pass the current object as an argument
Continue with a revision plan
These learning objectives are available to everyone. Sign in with an eligible plan to read the full note and worked examples.
