exam with verified answers.
Terms in this set (1741)
Class Definition of a type ; a plan or blueprint( i.e. Strings defines
anything that is a string)
Object A specific instance of a class or a thing that fulfills the
definition that all other things of that definition fulfill
(i.e. A specific string = specific instance)
, Specifies the members of the objects
-Instance Variables
Class -Methods
Instance Variables
Attributes of a class
Methods
Actions class can complete
Can be public/private,
static/non-static, and of a
certain type(primitive/class)
Instance Variables
Methods Can be public/private, static/non-static,
and have a variables with scope within
it, and have a return type
(primitive/class) returning only one
thing.
Non-static Method Must be called by an instance of the class in which it resides
Static Method Can be called directly by choosing the name of the class and
method name
Creating a constructor
, Points to the address that holds the
instance variables of the ____and gives
access to the method of the class
Instance
_______ calls the method about
because about is ______, and must be
r1 Instance, non-static, called by an _______ of the class it
instance resides
Method Header Make up the _______
*modifiers (public/private)
*invocation(non-static/static)
*return_type(void, primitive, class, single)
*name(verb, first lowercase letter)
*parameter_list(number and type of arguments to be passed
Declaring a Program
Getters Returns variable, always public, Control access to the variable
Setters Sets the value of the instance variable, always public,
Controls access to CHANGE of variable
Private Methods that can only be called from the class in which it
resides in.
Default Constructor No arguments are passed to it ; assigns every instance variable
with a null value; should be overrided
Non-default constructor Arguments are passed to it; Helps to construct an instance of
the class
, Constructors *Must always have the same name of the class they're in
*Always public
*Never have a return type (not even void) *If you
have a non-default one you must have a default
*Should give a value to every instance variables
*Should be the 1st methods of the class
*STRONGLY recommended but not required
Type name = new Type(); The format of making a constructor.
Constructors Create the instance.
Constructors Only execute the time when the instance is created.
super(); A class that is an sub part of another should have this at the
first line; A call to the constructor of the parent class.
A ______ method may be called
nameOfTheClassInWhichTheMethodResides.methodN
Static ame(required arguments); or
instanceOfTheClassInWhichTheMethodResides.metho
dName(required arguments);
Non-static A _______ method may only be called
instanceOfTheClassInWhichTheMethodResides.metho
dName(required arguments);
Static variable A variable that is shared by all the instances of the class in
which that variable is declared
Static variable Memory space is put in place not for one instance but for all
instances. One change from an instance affects all instances
toString Returns the memory address of the instance that called the
method