Problems compiling

Posted on 2011-04-24
Last Modified: 2012-05-11
I have a program that will not compile using javac command in my command prompt i get this as a response
Note: uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

I'm not sure what that means and is there something i can do to avoid this?

It work in my IDE but i need it to compile just using the javac command in dos prompt.

Here is the code
// ip3:
//  random integers.
import java.util.HashSet;
import java.util.Iterator;
import java.util.Random;
import java.util.Set;

public class Lotto
      public static void main( String[] args )
         Set lottoSet = new HashSet(); //sets can only contain unique values

         //do entire procedure 8 times
         for (int counter = 0; counter < 8; counter++)
             // Loop until lottoSet contains 7 values
             //  since a Set cannot contain duplicates, we know we have 7 unique numbers when size = 7
             while (lottoSet.size() != 7)
                // pick random number between 1 - 35 and add it to set
             } // end while

             //display numbers in set + powerball number

             //clear set so it can be reused
      } // end main

      private static int generateRandomNumber(int range)
        return (int) (range * Math.random() ) + 1;

      private static void displaySet(Set set)

        Iterator it = set.iterator();
        // iterate through set & display the numbers

            // print number followed by a comma
            System.out.print( + ", ");


        //print powerball number (between 1 & 10) and create a new line
   } // end class lotto java.util.HashSet


Question by:drivenit
    LVL 86

    Expert Comment

    That's a warning, not an error. Why don't you try following the advice the warning gives you?
    LVL 47

    Accepted Solution

    This is just a warnng it created the class don't worry about it
    LVL 1

    Author Closing Comment

    Very Quick and helpful
    LVL 86

    Expert Comment

    drivenit, can you tell me why you accepted an answer that duplicated my earlier one?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Suggested Solutions

    Title # Comments Views Activity
    post4 challenge 28 69
    method argument as final 1 54
    wordsFront challenge 8 46
    strCount chalenge 3 31
    Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
    Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
    The viewer will learn how to implement Singleton Design Pattern in Java.
    This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now