M5 pt 2 Flashcards

1
Q

declared either at the start or end
of a class definition. These variables identify
the data stored in the object.

A

Attributes –

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

a method that is automatically
executed when an object is created. This
method is used to initialize the attributes.

A

Constructor –

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

a method that is used

to change the data.

A

Mutator (Setter) –

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

a method that is

used to access or retrieve data.

A

Accessor (Getter) –

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

implement the business
rules for which the application is being
developed

A

Custom Methods –

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Steps in Declaring Classes

A
  1. Define the class name
  2. Declare the attributes
  3. Create constructor
  4. Create standard methods
  5. Create custom methods
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

class declaration syntax

A
class  {
//code 
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

attributes declaration syntax

A

ex. private String name;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

constructor declaration syntax

A
  • {
  • //code here
  • }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Create standard methods (setters) syntax

A
  • setXxx(args list)
  • {
  • //codes here
  • }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Create standard methods (getters) syntax

A
  • getXxx (args list)
  • {
  • //codes here
  • }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Create custom methods syntax

A
  • {
  • //codes here
  • }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

contains a reference to the current object being
constructed. It represents an instance of the class in
which it appears. It can be used to access class variables
and methods.

A

this keyword

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

can be used to refer current class instance variable.

A

this()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
can be used to invoke current class 
constructor.
A

this()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
can be used to invoke current class method 
(implicitly)
A

this()

17
Q
Variable: a variable 
that is only accessible 
within a class where it 
is declared.
Method: a method that 
is only accessible 
within the class where 
it is declared.
A

private

18
Q
Variable: a variable 
that is accessible from 
all classes.
Method: a method that 
is accessible from all 
classes.
A

public

19
Q
The default modifier is 
accessible only within 
the package.
If you don't use any 
modifier, it is treated 
as default by default.
A

default (no keyword)

20
Q
The protected access 
modifier is accessible 
within and outside the 
package but through 
inheritance only.
It can be applied on 
the data member, 
method and 
constructor. It can't be 
applied on the class.
A

protected

21
Q

modifiers/qualifiers

A

final, static, abstract, interface

22
Q

variables stored in each object of a class,
usually referred to as the non-static member
fields of a class

A

Instance Variables (non-static fields) –

23
Q
variables stored in the class and are 
available to all objects of a class or objects 
of other classes if access is permitted, 
usually referred to as the static members of 
the class.
A

Class Variables (static fields) –

24
Q

data used in a method. This
data is temporary and does not exist once
the method has completed execution.

A
Local Variables (method variables or 
local data) –