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 162221
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:21:08+00:00 2026-05-11T11:21:08+00:00

Which is better? @SuppressWarnings(unchecked) @SuppressWarnings(AnnotationConstants.UNCHECKED) Where AnnotationConstants is a typical constants class… public final

  • 0

Which is better?

  1. @SuppressWarnings('unchecked')
  2. @SuppressWarnings(AnnotationConstants.UNCHECKED)

Where AnnotationConstants is a typical constants class…

public final class AnnotationConstants {     private AnnotationConstants() { }      public static final String UNCHECKED = 'unchecked';      ... } 

I know that there are a lot of general arguments for and against constants classes–and that’s exactly what I’m not interested in. I want to know if a constants class specifically for annotations is a good idea or a bad idea.

  • 1 1 Answer
  • 2 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. 2026-05-11T11:21:09+00:00Added an answer on May 11, 2026 at 11:21 am

    For this specific example I’d stick with literals. After all, you’re trying to suppress warnings – if you use the wrong literal, the warning won’t be suppressed, which will draw your attention to the problem.

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

Sidebar

Related Questions

which is better ??? public class Order { private double _price; private double _quantity;
Which is better? 1. = link_to Page, /page, :class => button, :data => {:theme
Which constitutes better object oriented design? Class User { id {get;set} } Class Office
Between interfaces and enums, which is better for declaring constants? Why is it so?
Which is better to use, and why, on a large project: #if DEBUG public
Which method is better?: add(new Label(label, new PropertyModel<String>(cat, name))); or add(new Label(label, cat.getName())); I
Which is better when floating elements to left right? Using a generic .clearfix class:
Which is better to use in PHP, a 2D array or a class? I've
Which is better for string literals, standard string or character array? I mean to
Which is better optimization? A series of if/else statement which receives the 'string' returns

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.