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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:39:13+00:00 2026-05-16T23:39:13+00:00

I have two packages – x and y. x contains the Student class and

  • 0

I have two packages – x and y.

x contains the Student class and the Grade enum.

y contains the Klass class.

Why is the type Student.Grade.C not recognized in the Klass class in package y?

Do I need to define it in its own file and make it public?

package x;

enum Grade { A, B, C, D, F, INCOMPLETE };

public class Student {

// blah, blah, member variables, getters, setters, constructors    

}


package y;

public class Klass {

 // This enum type is not recognized in this package
 public static final MINIMUM_GRADE = Student.Grade.C; 

}
  • 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-16T23:39:14+00:00Added an answer on May 16, 2026 at 11:39 pm

    Yes, you do have to declare that enum public. You shouldn’t have to have it in its own file.

    You would access just like your example Student.Grade.C;

    You could import Student.Grade and just use C in your code.

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

Sidebar

Related Questions

I have two packages client and server: the client package contains an interface I_object:
I have two packages. The class I want to import from the first package
I have these two modules : package G1; sub new { my $class =
I have two classes. package utilities; public class PostCaller { public String getUrl() {
I have 2 packages which contains more than 20 functions and procedures. The two
i have two impl packages (contains implementation for service/dao methods) and i want when
I have two activities with same name on two different packages. One is just
I'm learning about packages. I have two classes that are in different packages and
I am evaluating datamining packages. I have find these two so far: RapidMiner Weka
I'd like to be able to have two protected classes in my package. 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.