- display a window on the screen - pixel: picture element - std unit of screen resolution - OO programs use objects - programmer-defined classes: we make - standard classes: come with Java package - dependency relationship - class that sends msgs to another is dependent on the obj it sends msgs to - UML diagram: dotted arrow from dependent - use object 1) declare 2) create 3) send msgs - obj declaration - every obj used must be declared - syntax: ; - class name must already be defined - object name can be comma-delim list of new objs of the class - use sys classes only for now - identifier - use to name class, obj, method, etc. - letters, digits, underscores, dollar signs - first must be letter - case-sensitive - no spaces - naming convention - uppercase first letter of classes - lowercase first letter of obj - multiple words: capitalize all subsequent words - obj creation - declaration does not create obj - syntax: - new (); - state of memory diagram not true UML - may use same identifier to refer to dif objs of same class @ dif times - deallocation - when no more references to an obj, eventually automatically erased - garbage collection: mechanism of deallocating unused space where automatically erased - msg sending - only after obj created - syntax: .(); - calling a method synonym for sending a message - 2 logical values - true, false - reserved words - identifiers used for certain purposes - cannot be used for any other purpose (e.g. obj name) Quick Check: 1. b (no spaces allowed), c (must begin with a letter), g (no commas or spaces allowed) 2. It should not use parentheses in the declaration, and it should insert a line declaring the JFrame: myWindow = new JFrame(); 3. The naming conventions are reversed in the first: usually MainWindow would be a class name, and mainWindow would be an instance name. In the second, you can only declare one type per statement. You should instead do: Account account; Customer customer; 4. b is valid; a uses the wrong type: String instead of boolean