19. Generic classes Flashcards

1
Q

What do we add to the name of a generic class in order to get a parameterized type?

A

ss

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

What is the purpose of a bound type parameter?

A

s

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

What is the difference between the following?

  1. public class C { }
  2. public class C { }
A

s

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

Why can we not refer to type parameters in static methods of a generic class? What else can we not do with type parameters?

A

s

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

What is the raw type of a generic class, and why does Java allow it to be used?

A

s

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

What is the difference between the following?

  1. 10
  2. new Integer(10)
A

s

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

Where is autoboxing and auto-unboxing occurring in the following?

Integer anInteger = 10;
Integer anotherInteger = anInteger + 1;
System.out.println(anotherInteger - anInteger);

A

s

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