Advertisement
bigLiukTheory

NomeEnumerazione

Oct 12th, 2013
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.34 KB | None | 0 0
  1. public enum NomeEnumerazione
  2. {
  3.     UNO(1), DUE(2), TRE(3);
  4.    
  5.     private int valore;
  6.    
  7.     NomeEnumerazione(int valore)
  8.     {
  9.         this.valore = valore;
  10.     }
  11.  
  12.     public int getValore()
  13.     {
  14.         return valore;
  15.     }
  16.  
  17.     public void setValore(int valore)
  18.     {
  19.         this.valore = valore;
  20.     }
  21.    
  22.     @Override
  23.     public String toString()
  24.     {
  25.         return ""+valore;
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement