How can I handle pass an enum from a class to another class. The passed enum inits another enum in Test2 class.
Here is an explanation of my problem. I know enum is final and cannot be override. So figure out the
this.Jun2 = E; The code is just explanation.
class Test1{
enum Junk{A,B,C};
Test2.loader(Junk);
}
class Test2{
enum Junk2{};
public static void loader(enum E)
this.Junk2 = E;
}
...other jobs based on Junk2;
The purpose of, Test2 class as an abstract class that handle enums which are desingned from extended classes like Test class
JunkandJunk2are two different types and cannot be assigned to each other. Can you explain a bit more what you are trying to achive, problably there is another solution to your problem. Btw an enum can implement an interface.