Question: Java, Choose best answer for the following questions. 1. The Java Collections API is a.) a set of interfaces and classes for containers b.) a
Java, Choose best answer for the following questions.
1. The Java Collections API is
a.) a set of interfaces and classes for containers
b.) a way of storing exception classes in Java programs
c.) not capable of using generics
d.) a set of related exceptions used when storing objects
e.) seldom used in real-world java programs
2. Java Generics allow us to
a.) specify a method name as a parameter
b.) specify a class constructor from outside the class
c.) create data members that do not exist in a class declaration
d.) specify a primitive data type as a parameter
e.) specify data type as a parameter in a class or method declaration
3. The main way the Set interface is different from a List interface is that
a.) a Set can hold multiple copies of an object while List can only hold sing copies
b.) a class that implements Set is used as a container that holds only a single instance of a class while List can hold many instances
c.) there are more classes that implement Set than there are for List.
d.) a Set can hold duplicates while List can hold no more than two copies
e.) a class that implements Set is meant to be used as a container that holds a single instance of each contained object.
4. The Collection interface from the java.util package is a superinterface of:
a.) Comparable, Serializable, and Cloneable
b.) List, ArrayList, and Serializable
c.) List, Set, and Map
d.) Exception, Throwable, and Error
e.) ArrayList, Vector, and LinkedList
5. Using a class like ArrayList or Vecotr in raw form will generate a Java compiler:
a.) warning and an exception at run time.
b.) error and a crash at run time
c.) warning and a debugger breakpoint
d.) warning but not an error
e.) error but not a warning
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
