import java.io.*;
public class EnumEx3
{
/**
* @param args
*/
public static void main(String[] args) {
Fishs fishs=Fishs.AMNON;
System.out.println(fishs.getX());
}
}
enum Fishs
{
BURI(20),
AMNON(50);
private int x;
private Fishs(int x) {
this.x=x;
}
public int getX() {
return x;
}
}
i have that code and i have no clue , why when i call the getX method from the main, the value of BURI is printed?
how do they connect , whats the process that happens inside java?