0

When compiling my Code, it highlights this in red:

    Note: /Users/myName/NetBeansProjects/CardGame/src/cardgame/Hand.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.

It still compiles and runs the program without fault (so far)... I was just curious to whether anyone would know whats causing it. Absolutely nothing appears on google and looking at my "Hand" Class, i can not see anything that should be causing an issue... :(

1
  • 1
    Have you tried adding the -Xlint:unchecked property when compiling the program to see a detailed explanation of the warning? Commented Nov 15, 2012 at 17:33

2 Answers 2

2

In Netbeans, right click on your project > Properties > Compiling > "Additional Compiler Options" and enter: -Xlint:unchecked.

Recompile and see what line is generating the warning.

Sign up to request clarification or add additional context in comments.

Comments

0

These are not compilation errors, they are some warnings. They say that you are not using generics or using them in a wrong way somewhere in your code.

For instance, something like this:

List list = new ArrayList();

should be:

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

1 Comment

Or type casting using generics: List<String> lstString = (List<String>)object;. Since OP hasn't post any code, it would be better for him/her to add the -Xlint:unchecked property when compiling the project.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.