CS 1114 Chapter 4: CS-1114 - Notes - Reading 3
Document Summary
Iii) public class ticketmachine outer wrapping/header (includes {, }) A scope of a parameter is restricted to its respective constructor or method in which it was declared. On the other hand, a scope of a field can be accessed anywhere within the same class: the lifetime of a given variable describes how long the variable continues to exist before it is destroyed. Accessor methods (accessors, or getters") return information regarding the state of an object typically includes a return statement. Mutator methods (mutators) change the state of an object. System. out. println( hello, world! ): non-void methods require a return statement; void methods do not. Conditional statements: see online reading vi for details. Local variables differ from fields, for they are declared within a given method instead of up top.