Results 1 to 3 of 3
  1. #1
    pedazo9234 is offline Member
    Join Date
    Feb 2012
    Posts
    1
    Rep Power
    0

    Unhappy ¿Why do I have an error in this allowed sentece in eclipse?

    Hi! I'm new in this forum, hello everybody

    I'm working in eclipse and I get the following error in this sentence:

    List<String> list = new ArrayList<String>();

    The error: "Type mismatch: cannot convert from ArrayList<String> to List<String>"

    I know that it is a correct sentence, I've seen it everywhere and in other computers it works...
    I need this object as a List, not as an ArrayList...

    Thank you so much

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    19

    Default Re: ¿Why do I have an error in this allowed sentece in eclipse?

    Have you either imported, or does the package this code appear in contain, something other than java.util.List or java.util.ArrayList?

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: ¿Why do I have an error in this allowed sentece in eclipse?

    I suspect a star import of java.awt.*

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. void type not allowed
    By jockhip12 in forum New To Java
    Replies: 6
    Last Post: 05-05-2011, 05:26 PM
  2. Allowed tags
    By swati.jyoti in forum XML
    Replies: 0
    Last Post: 07-22-2009, 06:58 AM
  3. How to extract information from a sentece
    By luisarca in forum Sun Java Wireless Toolkit
    Replies: 1
    Last Post: 12-03-2007, 11:34 AM
  4. Replies: 1
    Last Post: 07-24-2007, 01:44 AM

Posting Permissions

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