Section 1

Preview this deck

Objects

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

1

All-time users

1

Favorites

0

Last updated

1 year ago

Date created

Mar 14, 2020

Cards (15)

Section 1

(15 cards)

Objects

Front

is a fundamental element in a program. A software object often represents a real object in our problem domain, such as a bank account. Every object has a state and a set of behaviors.

Back

Return statement

Front

An explicit return statement is used to specify the value that is returned from a method. The type of the return value must match the return type specified in the method definition. A return statement is required in methods that have a return type other than void. A method that does not return a value could use a return statement without an expression, but it is not necessary. Only one return statement should be used in a method.

Back

Access modifier

Front

A Java modifier that defines the scope in which a construct can be accessed. The Java visibility modifiers are public, protected, private, and default (no modifier used).

Back

Private vs Public

Front

Private: A Java reserved word that serves as a visibility modifier for inner classes as well as methods and variables. A private inner class is accessible only to members of the class in which it is declared. Private methods and variables are visible only in the class in which they are declared. Public: A Java reserved word that serves as a visibility modifier for classes, interfaces, methods, and variables. Anything declared public is visible to all classes.

Back

Break statement

Front

When a break statement is executed, the flow of execution transfers immediately to the statement after the one governing the current flow. For example, if a break statement is executed within the body of a loop, the execution of the loop is stopped and the statement following the loop is executed. It "breaks" out of the loop.

Back

Operator

Front

A symbol that represents a particular operation in a programming language, such as the addition operator (+).

Back

Operation

Front

An operation is a function that can be done to or done by an object. For example, one operation of a Student object might be to compute that student's current grade point average. Collectively, an object's opera- tions are referred to as the object's behaviors.

Back

Modifier

Front

A designation used in a Java declaration that specifies particular characteristics to the construct being declared.

Back

The heart of object-oriented programming is defining classes that represent

Front

The heart of object-oriented programming is defining classes that represent objects with well-defined state and behavior.

Back

Objects have

Front

graphical representation, meaning that their state and behaviors include information about what the object looks like visually. A graphical object might contain data about its size and color, for instance, and it may contain methods to draw it. An object's attributes are associated with that object.

Back

Scope of method variable

Front

The location at which a variable is declared defines its scope, which is the area within a program in which that variable can be referenced. By being declared at the class level (not within a method), these variables and constants can be referenced in any method of the class. The scope of a variable, which determines where it can be referenced, depends on where it is declared. the scope of a variable or constant is the part of a program in which a valid reference to that variable can be made.

Back

Attribute

Front

An object's attributes are the values it stores internally, which may be represented as primitive data or as other objects. For example, a bank account object may store a floating point number (a primitive value) that represents the balance of the account. It may contain other attributes, such as the name of the account owner. Collectively, the values of an object's attributes define its current state.

Back

Constructor

Front

A special method in a class that is invoked when an object is instantiated from the class. Used to initialize the object.

Back

Method of variable

Front

A variable declared in a method is local to that method and cannot be used outside of it.???

Back

Formal and actual parameter

Front

The names of the parameters in the header of the method declaration are called formal parameters. In an invocation, the values passed into a method are called actual parameters. The actual parameters are also called the arguments to the method. When a method is called, the actual parameters are copied into the formal parameters.

Back