Results 1 to 5 of 5

Thread: Warning message

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2010
    Posts
    10

    Warning message

    Hi,
    I am quite new to java and got following warning message after compiling:
    Note:...\Player.java uses unchecked or unsave operations.
    Note:Recompile with -Xlint: unchecked for details.

    I got the message after adding following method:
    Code:
     public boolean controleOverlappend(ArrayList<Position> coordinaten)
        {
            boolean value=false;
            Set coordinatenSet=map.keySet();
            Iterator<Position> it=coordinatenSet.iterator();
            Iterator<Position> it2=coordinaten.iterator();
            while (it2.hasNext()){
                
                while(it.hasNext()){
                   value= !it2.next().equals(it.next());
    
                }
            }
            return value;
                
        }

  2. #2

    Thread Starter
    New Member
    Join Date
    Mar 2010
    Posts
    10

    Re: Warning message

    Can anyone tell me what's wrong, or is this too few information?

  3. #3
    PowerPoster kfcSmitty's Avatar
    Join Date
    May 2005
    Posts
    2,248

    Re: Warning message

    Java 1.5 implemented a new feature: Generics.

    For more information on it check out: http://java.sun.com/j2se/1.5.0/docs/.../generics.html

  4. #4
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: Warning message

    Instead of using the plain Set class, you need to use the generic Set<T> where T is Key class of your Map m
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2010
    Posts
    10

    Re: Warning message

    Ok, thank you!

Posting Permissions

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



Click Here to Expand Forum to Full Width