I created a class Test with 3 inner Objects of class Test.
pblic class Test
{
public static final Test test1=new Test("a");
public static final Test test2=new Test("b");
public static final Test test3=new Test("c");
//instance
public static String instance;
public Test(String init)
{
instance=init;
}
.
.
.
This works so far. Than I have a enum file where I do this:
public enum myEnum
{
APPLE{{this.enumtest=Test.test1}};
Test enumtest;
.
.
.
When I call enumtest.toString I receive the String of test3 not test1. I thought every inner class Object has it's own parameter instance but it seems that it gets overwritten till the lase object was created. Is there any way to solve this problem? Thanks