Exam 17: Generics
Exam 1: Introduction to Computers and Java42 Questions
Exam 2: Java Fundamentals53 Questions
Exam 3: Decision Structures52 Questions
Exam 4: Loops and Files48 Questions
Exam 5: Methods50 Questions
Exam 6: A First Look at Classes49 Questions
Exam 7: A First Look at Gui Applications49 Questions
Exam 8: Arrays and the Arraylist Class52 Questions
Exam 9: A Second Look at Classes and Objects40 Questions
Exam 10: Text Processing and More About Wrapper Classes49 Questions
Exam 11: Inheritance49 Questions
Exam 12: Exceptions and Advanced File Io46 Questions
Exam 13: Advanced Gui Applications46 Questions
Exam 14: Applets and More39 Questions
Exam 15: Recursion34 Questions
Exam 16: Sorting, Searching, and Algorithm Analysis46 Questions
Exam 17: Generics50 Questions
Exam 18: Collections50 Questions
Exam 19: Array-Based Lists20 Questions
Exam 20: Linked Lists36 Questions
Exam 21: Stacks and Queues36 Questions
Exam 22: Binary Trees, Avl Trees, and Priority Queues45 Questions
Select questions type
Which of the following statements is true?
Free
(Multiple Choice)
4.9/5
(37)
Correct Answer:
B
Let Point< T > be a generic type.We want to write a method that takes as parameter Point objects whose type parameter is the Number class,or any subclass of Number.We can do this by declaring the type of the method parameter as
Free
(Multiple Choice)
4.9/5
(34)
Correct Answer:
C
The code fragment
Class MySArrayList extends ArrayList< String >
{
}
Free
(Multiple Choice)
5.0/5
(29)
Correct Answer:
A
The process used by the Java compiler to remove generic notation and substitute actual type arguments for formal type parameters is called
(Multiple Choice)
4.8/5
(44)
Suppose that Point< T > is a generic type,and that we have a method of the form
Void printPoint(Point< ? > p){
// Code not shown
}
(Multiple Choice)
4.8/5
(41)
Look at the following method header:
Void displayPoint(Point< ? super Double > myPoint)Which of the following objects can be passed as an argument to the displayPoint method?
(Multiple Choice)
4.8/5
(35)
Let Point< T > be a generic type.We want to write a method that takes as parameter Point objects whose type parameter is the Number class,or any superclass of Number.We can do this by writing
(Multiple Choice)
4.9/5
(37)
When a generic class with an unconstrained type parameter is instantiated without specifying an actual type argument,
(Multiple Choice)
4.7/5
(32)
When you create an instance of a generic class,what types can you pass as arguments for the class type parameters?
(Multiple Choice)
4.9/5
(32)
The class
Public class Point3D< T extends Number > extends Point< T > {
}
Is an example of
(Multiple Choice)
4.9/5
(36)
The declaration
Class Point< T extends Number >
{
}
Is an example of
(Multiple Choice)
4.9/5
(37)
When a generic class is instantiated without specifying an actual type argument,the generic class is being used
(Multiple Choice)
4.9/5
(37)
Showing 1 - 20 of 50
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)