Lab 03 - Exceptions, Generics,Exercises 2,3
Exercise 2 Review
Do we need a LeaveQueueEvent?
Exceptions
Generics
Generic Type Parameters
Scope of Type Parameters
class A<T> {
public static T foo() {...}
public static <S> S bar1() {...}
public static <S> T bar2() {...}
public static <T> T bar3() {...}
}Classic Questions
Question 1 (Type Checking)
Code Snippet
Compiles?
Reason
Question 2 (Type Checking)
Method Call
Compiles?
Return Type
Explanation
PreviousLab 02 - Interface,Wrapper Class, Exercise 1,2NextLab 04 - Wildcard,Nested Class, Java package
Last updated