Start learning 50% faster. Sign in now
In this code, an ArrayList is created and populated with three elements. The add() method is used to insert 15 at index 1. This insertion shifts the other elements accordingly. Let's break down why the correct output is B and explain why the other options are incorrect: · Explanation of Correct Option (B): Initially, the ArrayList contains [10, 20, 30] . When list.add(1, 15) is executed, it inserts the value 15 at index 1 . This causes the elements at index 1 and 2 (i.e., 20 and 30 ) to be shifted one position to the right. After the insertion, the list looks like this: [10, 15, 20, 30] . The call to list.get(2) retrieves the element at index 2 , which is now 20 . · Why the Other Options Are Incorrect:
Four number-pairs have been given, out of which three are alike in some manner and one is different. Select the number-pair that is different.
Which of the following is related to the third word as the second is related to the first.
Light:Darkness::Knowledge:?
In each of the following questions, choose that set numbers from the four alternative sets, that is similar to the given set.
Given set: [...
Select the option in which the numbers share the same relationship as that shared by the number in the set given below.
(19, 42, 28)
(11, 39, 33)
Select the related number from the given alternatives.
CDE : HIJ :: KLM : ?
Find the odd one out pair.
Select the combination of letter that when sequentially placed in the blanks of the given series will complete the series.
_ O _ _ S G _ A _ S...
Inch Foot :: Meter: ?
England: Apple:: Iran: ?