可见性与领域概念
/** from * n o w j a v a . c o m **/ class TestClass { private long visibleOnlyInThisClass; double visibleFromEntirePackage; void setLong (long val) { visibleOnlyInThisClass = val; } long getLong () { return visibleOnlyInThisClass; } } public class Main { public static void main(String[] args) { /**来自 时代Java - nowjava.com**/ TestClass tc = new TestClass(); tc.setLong(32768);