accessibility in java\ Flashcards

(9 cards)

1
Q

private

A

can only be accessed by objects of the same class that it is in

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

public

A

can be accessed by any function or process in the program

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

default

A

cannot be accessed by objects in different packages

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

protected

A

can be accessed by subclasses/objects in different packages, but only through inheritance

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

accessibility

A

private, public, protected, default(if not specified)

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

public accessibility

A

can be accessed in any class and package

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

protected accessibility

A

can be accessed by classes and subclasses in the same package

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

default accessibility

A

can be accessed by classes in the same package; added by omitting a modifier

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

private accessibility

A

no other class can access, only within same class

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