• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ArrayList

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Drag and drop either "true" or "false" above the following options that are based on this code fragment.
List < ? > l = new ArrayList< Integer > ();

: This code fragment will not compile
: Nothing can be added to this List.
: Anything beside Integer could be replaced on the right hand side.

I coudn't understand the question.Can you please explain.What is ? >.
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by radhika ayirala:
... Can you please explain.What is ? >.


It's a generics wildcard.

At the bottom of this page on generics is a link to a PDF generics tutorial. See if that helps.
 
Ranch Hand
Posts: 278
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what is the answer.
 
radhika ayirala
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is the answer:

FALSE : This code fragment will not compile
TRUE : Nothing can be added to this List.
TRUE : Anything beside Integer could be replaced on the right hand side.
reply
    Bookmark Topic Watch Topic
  • New Topic