public class JustPractice {
public int points=0;
public static void main(String args[]) {
JustPractice ha = new JustPractice();
ha.end();
happy();
}
public void end() {
this.points=100;
System.out.println(points);
}
public static void happy() {
JustPractice object = new JustPractice();
System.out.println(object.points);
return;
}
}
Run Code Online (Sandbox Code Playgroud)
以上是显示:
100
0
而它应该显示:
100
100
java ×1