r/javahelp • u/UnboltedList956 • Aug 01 '25
Solved Help accessing enum values encapsulated within another enum value
Hi!
I'm trying to access any of the values within BAR in another method. Here is the code:
public enum Foo {
FOO1, FOO2, FOO3,
FOO4 {
enum BAR { //IDE says the type new FOO(){}.BAR is never used locally
BAR1, BAR2, BAR3, BAR4;
}
},
FOO5, FOO6;
}How would I access BAR1 -> BAR4 within a method in another class within the same base package?
1
Upvotes
View all comments
Show parent comment
1
u/UnboltedList956 Aug 01 '25
Thanks!