Saturday, September 27, 2014

Enum


public class EnumTest {
    State test;
   
    public void setCurrentState(State currentState) {

        test = currentState;
    }
    public State getCurrentState() {

        return test;
    }
   

    public static void main(String[] args) {
        System.out.println(State.FrameworkInatilize);
        System.out.println(State.test);
        EnumTest test=new EnumTest();
        test.setCurrentState(State.Notify);
        test. stateSwitch();
     
     
       
     
       
       
       
       
    }
    public void stateSwitch() {
        switch (getCurrentState()) {
        case Notify:
            System.out.println("Notify");
            System.out.println( test.isNotify());
            break;
        default:
            break;
        }

}
}

No comments:

Post a Comment