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
    6

    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,323
    Rep Power
    7

Similar Threads

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