基础----Java的作用域
class Scope{ private int x; public int getX() { return x; } public void setX(int x) { this.x = x * 3; } } public class ScopeTest extends Scope{ public static void main(String[] args) { int a = 100; Scope se = new Scope(); se.setX(a); System.out.println(a); // 这里输出多少 ? } }
output: 100