#11 inner classes Flashcards

1
Q

type erasure

A

how java implements generics:

type T is replace by object type. Then when you want to return T, Java cast the object to the type you want

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

advantage of generics

A

uses are checked at compile time rather than runtime

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

inner class

A

class defined inside scope of other class

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

inner class can access

A

all fields and methods in its outer class

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

outer class can access

A

all fields and methods in its inner class

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

inner classes can be viewed out side the outer class??

A

heck yea if it does not have privacy modifiers that keep it private

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

relationship between inner and outer classes

A

inner class objects must be instantiated with an outer class object. (linked at birth)

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

is an inner class a subclass?

A

nope

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

to use an inner class outside its outer class

A
OuterClass.InnerClass
(inner class obj. is associated with the OuterClass in the dot notation)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

use inne rclass inside outer class

A

use inner class normally

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