Question: Consider the following code: ArrayList code From the following, select the correct answer. Question 1 Answer a . This code cannot work correctly, because we
Consider the following code:
ArrayList code
From the following, select the correct answer.
Question Answer
a
This code cannot work correctly, because we are not allowed to store data of different types in an ArrayList ie numbers and strings
b
This code cannot work correctly, because we are not allowed to store primitive data ie the int value in an ArrayList
c
This code works correctly because the integer value is automatically converted to a string
d
This code works correctly due to polymorphism.
e
This code can work correctly only in old versions of Java and below
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
