为什么封装后的变量a还可以访问?
package package1; public class Bus { private int a; float b; String c; public static void main(String[] args) { Bus car=new Bus(); car.a=500; } }
package package1; public class Bus { private int a; float b; String c; public static void main(String[] args) { Bus car=new Bus(); car.a=500; } }
2018-03-22
举报