Please enable JavaScript.
Coggle requires JavaScript to display documents.
AP CS CH3: Classes and Objects - Coggle Diagram
AP CS CH3: Classes and Objects
public private and static
public
usable by all client programs
anywhere in the code can use it
private
can only be accesed by methods of the same class it is in
static variable
value that is shared by all instances of the class
eg: number of employees, combined revenue
methods
headers
all methods need headers exept for contructors
access specifier
public
return type
void, int, etc
prarameter list
accesors
accessesclass object without changiing it
mutator
chances the state of an object my modifying at least one of its instance variables
contructors
creates an object of the class
no argument and argument contructor
has to be same name as class no return type
static methods
references
primitive
built in data types like double and int
reference
string, int[] etc
objects and classes
objects
objects are what a program manipulates
eg: 4 digit number
characterized by its state and behavior
for a book, its author, title etc
object reference
represent an object as a variable
classes
software blueprint for implementing objects of a given type
an object is one instance of a class
data encapsulation
combining an objects data and methods into a single unit called a class
state maintained in data fields or instance variables
scope