My Java Quiz

The ultimate place to learn Java!

Question #82: What is the output of the following code?

public static void main(String args[]){
    System.out.println(fun());
}

static int fun() {
    static int x= 0;
    return ++x;
}