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:
Aryan, Bhavya, and Chetan initiated a venture with initial investments of Rs. 50,000, Rs. 60,000, and Rs. 72,000 respectively. After six months, Aryan, ...
Calculate the value of 'R' if 30% of 'R' equals 40% of Rs. 4,500.
The marks scored by a boy in three subjects are in the ratio 2 : 3 : 5. Boy scored an overall aggregate of 60% in the exam. If the maximum marks in each...
The price of a commodity rises by 20% in the first year and an additional 15% in the second year. If the initial price was ₹2,000, what will be its pr...
The marks obtained by A is 25% more than B, and the marks obtained by C is 140 more than the difference of the marks obtained by A and B. If C obtained ...
A salesman is allowed 12% commission on the total sales by him and a bonus of 1% on the sales over Rs. 10000. If the total earnings of a salesman is Rs....
In each population, 30% of the population is affected with asthma out of which 90% of asthma patients used to work in flour mills. If 30% of the total p...
0.5 is what percentage of 20?
In an examination, 4 marks are given for each correct answer and 1 mark is deducted for each wrong answer. If a candidate solved 75 questions and got 12...
A man spends 72% of his income. If his income increases by 28% and his expenditure increases by 25%, then what is the percentage increase or decrease in...