Exam 14: Generics and the Arraylist Class
Exam 1: Getting Started46 Questions
Exam 2: Console Input and Output29 Questions
Exam 3: Flow of Control43 Questions
Exam 4: Defining Classes I44 Questions
Exam 5: Defining Classes Ii46 Questions
Exam 6: Arrays47 Questions
Exam 7: Inheritance43 Questions
Exam 8: Console Input and Output43 Questions
Exam 9: Exception Handling45 Questions
Exam 10: File IO46 Questions
Exam 12: Uml and Patterns22 Questions
Exam 13: Interfaces and Inner Classes32 Questions
Exam 14: Generics and the Arraylist Class31 Questions
Exam 15: Linked Data Structures43 Questions
Exam 16: Collections and Iterators44 Questions
Exam 17: Swing I37 Questions
Exam 18: Swing II31 Questions
Exam 19: Java Never Ends18 Questions
Exam 11: Recursion43 Questions
Exam 20: Applets25 Questions
Select questions type
A class definition can have more than one type parameter.
Free
(True/False)
4.9/5
(34)
Correct Answer:
True
Write Java statements to display the size of the resulting ArrayList from question 5 above.
Free
(Short Answer)
4.7/5
(39)
Correct Answer:
System.out.println(list.size());
When using ArrayLists the method _______ can be used to save memory:
Free
(Multiple Choice)
4.8/5
(41)
Correct Answer:
A
Inheritance is the reason why some parameters of the ArrayList class are of type Base_Type and others of type Object.
(True/False)
4.8/5
(38)
A class obtained from a generic class by plugging in a type for the type parameter is said to ________ the generic class.
(Multiple Choice)
4.9/5
(35)
You can use any primitive type as the base type of an ArrayList class.
(True/False)
4.8/5
(30)
All of the following are methods of the ArrayList class except:
(Multiple Choice)
4.8/5
(31)
You can not use the set method to put an element at just any index.
(True/False)
4.8/5
(34)
What is the base type of the ArrayList defined in question number 2?
(Short Answer)
4.7/5
(37)
All of the following are memory management methods of the ArrayList class except:
(Multiple Choice)
4.8/5
(32)
A generic class can be instantiated as any of the following base types except:
(Multiple Choice)
4.8/5
(38)
To place an element in an ArrayList position for the first time,you usually use the method:
(Multiple Choice)
4.9/5
(34)
The remove(Object theElement)method of the ArrayList class returns:
(Multiple Choice)
4.8/5
(37)
To use the Java class ArrayList,you must import the package:
(Multiple Choice)
5.0/5
(40)
All of the following are methods of the ArrayList class except:
(Multiple Choice)
4.9/5
(37)
A/An ____________ can change the length while the program is running.
(Multiple Choice)
5.0/5
(40)
Showing 1 - 20 of 31
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)