Q:

Using Enum as a int value

Am trying to use Enum as Constants for readability as below .
Public enum x { test1 , test2 , test3 }

I want to pass this enum into a method and use it as a int value as shown
private void (int type)
{ 
  switch(int) 
  {
    case enum.X:
          // do somthing 
           break;
   }
 } ;

Can we use enum here as its more clearer than using a int value .( like switch 1 etc) . Is it possible to use this way.?

A:

Yes, you should be able to use an enum in a switch statement in Java:
public enum SomeEnum { FOO, BAR, BAZ };

// in a class...
private void something(SomeEnum s) {
    switch (s) {
        case FOO:
            // do something
            break;
        case BAR:
            // do something else
            break;
    }
}

Not sure I understand how int values tie into this, but you can have fields/methods on an enum like in a normal Java class, and can use these to hold int (or any other type) values as on any other POJO.
Here's an example in which we declare a constructor for an enum class, so that you can pass in values for internal variables at the time each instance of the enum is constructed.  To help you follow what's going on: First we declare the items in the enum - each declaration invokes the constructor, so we can pass in instance variables here.  Then the code for the enum class follows, as with a normal Java class. 
public enum AnotherEnum {
    ONE(1, "un"), TWO(2, "deux"), THREE(3, "trois"), FIFTY_SEVEN(57, "cinquante-sept");

    private final int someInt;
    private final String french;
    private AnotherEnum(int i, String s) {
        this.someInt = i;
        this.french = s;
    }
    public int getSomeInt() {
        return this.someInt;
    }
    public String getFrench() {
        return this.french;
    }
}

So for example, System.out.println(AnotherEnum.TWO.getSomeInt()) would print 2, and System.out.println(AnotherEnum.FIFTY_SEVEN.getFrench()) would print cinquante-sept.

