Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 746595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T14:06:32+00:00 2026-05-14T14:06:32+00:00

I think I get what unchecked cast means (casting from one to another of

  • 0

I think I get what unchecked cast means (casting from one to another of a different type), but what does it mean to “Check” the cast? How can I check the cast so that I can avoid this warning in Eclipse?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T14:06:32+00:00Added an answer on May 14, 2026 at 2:06 pm

    Unchecked cast means that you are (implicitly or explicitly) casting from a generic type to a nonqualified type or the other way around. E.g. this line

    Set<String> set = new HashSet();
    

    will produce such a warning.

    Usually there is a good reason for such warnings, so you should try to improve your code instead of suppressing the warning. Quote from Effective Java, 2nd Edition:

    Eliminate every unchecked warning that you can. If you
    eliminate all warnings, you are assured that your code is typesafe, which is a very
    good thing. It means that you won’t get a ClassCastException at runtime, and it
    increases your confidence that your program is behaving as you intended.

    If you can’t eliminate a warning, and you can prove that the code that
    provoked the warning is typesafe, then (and only then) suppress the warning
    with an @SuppressWarnings("unchecked") annotation. If you suppress warnings
    without first proving that the code is typesafe, you are only giving yourself a
    false sense of security. The code may compile without emitting any warnings, but
    it can still throw a ClassCastException at runtime. If, however, you ignore
    unchecked warnings that you know to be safe (instead of suppressing them), you
    won’t notice when a new warning crops up that represents a real problem. The
    new warning will get lost amidst all the false alarms that you didn’t silence.

    Of course, it is not always as easy to eliminate warnings as with the code above. Without seeing your code, there is no way to tell how to make it safe though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

OK I think I get Difference between jQuery.extend and jQuery.fn.extend? in that the general
This is a practical Domain Driven Design question: Conceptually, I think I get Aggregate
I'm beginning to think that to get a ProgressDialog to work the AsyncTask has
I think i was doing halfway good to get this to halfway work. Anyways
I think something buggy is up with my GET method as I am getting
Do you think jquery could help me get the following script work faster? Thanks!
I'm trying to get my team to think about only asking the database to
How to get base url in jQuery? Think I am in http://localhost/test/test_controller/test 's js
I have been trying to get this to work correctly and I think I
I'm using a method as explained here: http://iamcam.wordpress.com/2008/01/15/unchecked-checkbox-values/ to get a value even if

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.