As you have concluded
Type
is a constant that cannot be changed. Thus you have to create a interface method and then simply implement this in each implementing class like this:
public interface Myglobal
{
public int getType();
}
public class A implements Myglobal
{
public int getType() { return 1; }
}