Results 1 to 2 of 2
  1. #1
    makpandian's Avatar
    makpandian is offline Senior Member
    Join Date
    Dec 2008
    Location
    Chennai
    Posts
    450
    Rep Power
    12

    Default Pbm in Generic WildCard?

    Hi all.

    I am just doing some code regarding Jave Generics Wild Card.


    List<? extends Object> list=new ArrayList<String>();


    list.add(new String("pandian"));

    System.out.println(list);


    When I compile this code.I got compilation Error. I dont know why?

    If you know share it with me?
    Mak
    (Living @ Virtual World)

  2. #2
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,342
    Rep Power
    12

Similar Threads

  1. Java Generic Plz Help
    By amtrbz in forum New To Java
    Replies: 1
    Last Post: 01-30-2011, 12:47 AM
  2. How to display WildCard search values
    By peliukasss in forum Lucene
    Replies: 1
    Last Post: 08-25-2010, 03:29 PM
  3. Replies: 2
    Last Post: 06-17-2010, 01:44 PM
  4. generic types
    By jon80 in forum New To Java
    Replies: 6
    Last Post: 06-12-2009, 11:29 PM
  5. Generic methods
    By andre1011 in forum Advanced Java
    Replies: 7
    Last Post: 02-25-2009, 03:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •