COSI 12b Study Guide - Comprehensive Final Exam Guide - Java Virtual Machine, Inheritance (Object-Oriented Programming), Iterator

202 views37 pages

Document Summary

State refers to the object"s data values, and behavior the object"s methods. Constructing an object: point = new point(); Constructors must have the same name as the class. Point p = new point(); p. y = 13; // changes state of y. Client code is code that interacts with objects. The state of an object can be changed inside a method. Point p2 = p1; p1 and p2 are different objects that point to the same reference. Unlike the string class, the stringbuffer class is mutable. Instance methods null null can be stored in a variable. Using the methods of an object is called dereference. Null cannot be dereferenced; it will cause a null pointer exception. An implicit parameter is the object which the instance method is called for. An object is an instance of a class, while a class is the template for an object. Fields are variables that exist in an object.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers