Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: unchecked or unsafe operations ERROR

  1. #1
    Junior Member
    Join Date
    Oct 2011
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default unchecked or unsafe operations ERROR

    This is the line of code generating the "unchecked or unsafe operations" error. There is an arrow that points to "new". How do I get rid of this error so I can compile my code?

    public static ArrayList<String>[] sbins = new ArrayList<String>[10];


  2. #2
    Member
    Join Date
    Mar 2011
    Posts
    66
    My Mood
    Relaxed
    Thanks
    12
    Thanked 4 Times in 4 Posts

    Default Re: unchecked or unsafe operations ERROR

    Do you think you can post the exact error message or your code?

  3. #3
    Junior Member
    Join Date
    Oct 2011
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: unchecked or unsafe operations ERROR

    Note: HW4c.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.

    so when I compile with -Xlint the program runs fine but there are like 10 warnings.

    warning: [unchecked] unchecked call to add<E> as a member of the raw type java.util.ArrayList
    sbins[7].add(s)

    and there is an arrow that points to the "(" after add.

Similar Threads

  1. Unchecked conversion error
    By Blehs in forum Java Theory & Questions
    Replies: 5
    Last Post: August 10th, 2011, 04:42 AM
  2. Unsafe cast
    By Kerr in forum Collections and Generics
    Replies: 2
    Last Post: April 19th, 2011, 07:49 AM
  3. Unchecked or Unsafe Operations
    By saxophonemaster in forum Collections and Generics
    Replies: 2
    Last Post: April 12th, 2011, 05:40 AM
  4. Unchecked or Unverified Warning
    By saxophonemaster in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 2nd, 2011, 09:59 PM
  5. unsafe operations note??
    By bookface in forum What's Wrong With My Code?
    Replies: 3
    Last Post: March 22nd, 2010, 10:58 AM