Java权限修饰符的使用 1.private private int ans; 只能在定义的类内部使用; 2.default(默认) int n; 同一个包内不同的类可以使用,含以上; 3.protected 不同的包的子类 4.public 同一个工程