Recompile in java

155 pts.
Tags:
Java
When I compile my java source code it shows me a note: Recompile with -xlint:unchecked for details. Can any one explain me why it is showing such a note?

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    Can any one explain me why it is showing such a note?   No, not unless we had the code you are compiling and your compile environment.   In order to tell, we would have to run your compile and add the -xlint:unchecked option when compiling. Then we could look at what the compiler messages were and tell you.   It would be a lot easier if you did it, though.   Tom
    125,585 pointsBadges:
    report
  • v1i2b3h4a5
    This is my code and my compile environment is JDK7import java.util.*; public class CIDemo{ public static void main(String[] args){ List ls = new ArrayList(); ls.add("ABC"); ls.add("xyz"); ls.add("abc"); System.out.println("Elements of array list \n"); Iterator itr = ls.iterator(); while(itr.hasNext()){ Object ele = itr.next(); System.out.println(ele); } }//End of main }//End of Collection interface
    155 pointsBadges:
    report
  • TomLiotta
    What happened when you recompiled with -Xlint:unchecked specified? (If you won't try it, why should we?) -- Tom
    125,585 pointsBadges:
    report
  • v1i2b3h4a5
    Finaly got it by just adding String after List and here is the code:import java.util.*; public class CIDemo{ public static void main(String[] args){ List<String> ls = new ArrayList<String>(); ls.add("ABC"); ls.add("xyz"); ls.add("abc"); System.out.println("Elements of array list \n"); Iterator itr = ls.iterator(); while(itr.hasNext()){ Object ele = itr.next(); System.out.println(ele); } }//End of main }//End of Collection interface
    155 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following