Java - Static Keyword
What will be the output of this code?
class Demo {
static int x = 5;
void change() {
x = 10;
}
}
public class Test {
public static void main(String[] args) {
Demo d1 = new Demo();
Demo d2 = new Demo();
d1.change();
System.out.println(d2.x);
}
}