Programming - Generic Types
You Are Here :: Home > JAVA > Generic Types - General Questions
7. |
________ refers to creating objects and storing primitive datatypes automatically by the compiler.
|
A. |
Boxing |
B.
|
generic |
C.
|
class
|
D.
|
Autoboxing
|
|
Answer: Option D
Explanation:
Autoboxing refers to creating objects and storing primitive datatypes automatically by the compiler. |
|
8. |
Generic types are defined as subtypes of the class __________
|
A. |
method |
B.
|
variable |
C.
|
object
|
D.
|
none
|
|
Answer: Option C
Explanation:
Generic types are designed to act upon objects. |
|
9. |
By using ______________________ types, it is possible to eliminate type casting in many cases.
|
A. |
non generic |
B.
|
generic |
C.
|
both
|
D.
|
none
|
|
Answer: Option B
Explanation:
Generic types are used to eliminate type casting in many cases. |
|
10. |
All the classes of ____________________ package have been rewritten using generic types.
|
A. |
java.lang |
B.
|
java.date |
C.
|
java.util
|
D.
|
java.sql
|
|
Answer: Option C
Explanation:
java.util package have been rewritten all the classes using generic types. |
|
11. |
Is generics are very flexible or not?
|
A. |
yes |
B.
|
no |
C.
|
Cant say
|
D.
|
none
|
|
Answer: Option A
Explanation:
The programmer can use the same generic type on any data type.so,it is very flexible. |
|
12. |
Generics let you enforce compile-time type saftey on _________________.
|
A. |
classes |
B.
|
methods |
C.
|
objects
|
D.
|
collections
|
|
Answer: Option D
Explanation:
In generics,collections are used to enforce compile-time type saftey. |
|
« prev
next »