Tino APCS

Object Behavior

Lesson Overview: It was recognized long ago that programming is best accomplished by working with smaller sections of code that are connected in very specific and formal ways. Programs of any significant size should be broken down into smaller pieces. Classes can be used to create objects that will solve those smaller pieces. We determine what behaviors these objects will perform. These behaviors of the objects are called methods.

Lesson Vocab
ARGUMENT

Values passed in to a method when it is called.

GETTERS

Methods that return the value of an attribute.

METHOD

Definitions of object behavior, or what an object can "do", defined in the class.

PARAMETER

Values that define what can be passed into a method, defined on method declaration.

return

A keyword telling the compiler that the value immediately following is to be outputted by the method.

SCOPE

Refers to the area of a program in which an identifier is valid and has meaning.

SETTERS

Methods that allow other classes to set the value of an attribute.

SIGNATURE

The information needed to call a method: (of the method) name, how many parameters it has, the type of each parameter, and the order of those parameters.

ACCESS MODIFIER

Key words that define when a field, method, constructor or class can be accessed.

PUBLIC

The public access modifier makes a field, method, constructor or class accessible in any other class.

PRIVATE

The private access modifier makes a field, method, constructor or class accessible only from the class it is declared in.

PROTECTED

The protected access modifier makes a field, method, constructor or class accessible only in subclasses and classes in the same package.

PACKAGE PRIVATE

When there is no access modifier, a field, method, constructor or class is has private package access which means it is accessible only in classes in the same package.