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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:10:25+00:00 2026-06-15T11:10:25+00:00

I have a simple Enum created public interface Params { public enum Locale {

  • 0

I have a simple Enum created

public interface Params
{
  public enum Locale 
  {
      UK("UK"), US("US");
      private String value;

      private Locale(String value) {
              this.value = value;
      }
  }; 

....

Here is my method I want to modify to take a Params.Locale attribute.

    public void doErrorQuery(Locale locale, String p_listStr)
    {
        if (p_spellingList == null)
        {
        result.setError(true);
        result.setErrorMessage("Null spelling list");
        return;
    }

I import my Locale enum using

import com.Params.Locale;

Problem is I can’t get this to compile, It’s telling me it can’t resolve the Locale. Even if I use Params.Locale it does not work, can’t resolve name.

  • 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-06-15T11:10:26+00:00Added an answer on June 15, 2026 at 11:10 am

    You should use an own enum class for the enum. Doing this would be a cleaner design in my eyes:

    public enum Locale {
       UK("UK"), US("US");
       private String value;
    
       private Locale(String value) {
           this.value = value;
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have this enum: [Flags] public enum SomeType { Val1 = 0,
Right now, I have an enum like this: public enum ReferenceType { Language =
In sample code, I have seen this: typedef enum Ename { Bob, Mary, John}
If I have a simple class like this one for a card: class Card
I have an enum class like the following: public enum Letter { OMEGA_LETTER(Omega), GAMMA_LETTER(Gamma),
I have created an attribute that accepts a (params) array in its constructor. internal
All - Need some insight into this issue. I have created a sample project
This question relates to casting of enums within generic methods Given an enum public
I have a collection of objects like so: public enum ObjectType { Type1, Type2
This is for Delphi Prism. Say, I have the following enum SET type that

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.