QUESTION 72 Suppose ArrayList x contains three strings [Beijing, Singapore, Toky
ID: 3740413 • Letter: Q
Question
QUESTION 72
Suppose ArrayList x contains three strings [Beijing, Singapore, Tokyo]. The following method call will cause runtime error:
x.remove(3)
True
False
QUESTION 83
You can use the methods in the Arrays class to shuffle an array.
True
False
QUESTION 84
When you create an array using new int[10], an array object is created with ten integers of value 0.
True
False
QUESTION 87
Suppose ArrayList x contains three strings [Beijing, Singapore, Tokyo]. The following method call will cause runtime error:
x.size()
True
False
question 90
You can insert an element anywhere in a linked list.
True
False
Explanation / Answer
Question 72 : True
ArrayList x contains three strings [Beijing, Singapore, Tokyo] which are in position 0,1,2.
The call to method x.remove(3) will cause runtime error as there are is no third element.
QUESTION 83: TRUE
Example : Java Collection.shuffle() method is used to shuffle elements of an array.
QUESTION 84: True
The elements in the array allocated by new will automatically be initialized to zero.
Hence when an array is created using new int[10], an array object is created with ten integers which are initialized to zero.
Question 87 : False
Invoking x.size() returns the number of the elements in an ArrayList x.
Here ArrayList x contains three strings [Beijing, Singapore, Tokyo] and x.size() returns 3.
Question 90: True
An element can be inserted anywhere in the linked list
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.