xis an instance variable, and yis global.
What does it mean?
Let's look at this example:
public class A {
public A() {
System.out.println("create A");
}
}
public class B {
public B() {
System.out.println("create B");
}
}
public class C {
private static B b = new B();
private A a = new A();
}
Then the main thing:
public static void main(String[] args) {
C c1 = new C();
C c2 = new C();
}
What print:
> create B
> create A
> create A
c1 c2 B, A!
c1.b == c2.b c1.a != c2.a.
, :
/ b C (c1, c2)
a / .
A B:
(int, float,...) / .