Following Correctly Declare Arraylist Arraylist List New Arraylist 10 Arraylist Double Lis Q37277868

Which of the following does not correctlydeclare an ArrayList?

  1. ArrayList‹list› = new ArrayList(10);
  2. ArrayList‹Double› list = new ArrayList‹Double›();
  3. ArrayList‹Double› list = new ArrayList‹Double›(10);

A. Statement I only

B. Statement II only

C. Statement III only

D. Statements I and II only

E. Statements II and III only


Answer


Answer A:

We need to specify the class name in both sides but in statement1 we did’t specify the properly at 2 sides and we did’t specify anyreference variable in statement 1

Note : If you like my answer please rate and help me it is veryImp for me

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.