再次分清访问权限
package com.chl.pone;public class Father {private int privateValue;int friendlyInt ;protected int protectedValue;public int publicValue;}package com.chl.pone;public class ClassSamePackage {public void publicMethod(){Father father = new Father();father.friendlyInt = 1;father.protectedValue = 1;father.publicValue = 1;}} package com.chl.pone;public class ChildSamePackage extends Father{public void publicMethod(){this.friendlyInt = 1;this.protectedValue = 1;this.publicValue = 1;}}package com.chl.ptwo;import com.chl.pone.Father;public class ChildNotSamePackage extends Father{public void publicMethod(){this.protectedValue = 1;this.publicValue = 1;}} package com.chl.ptwo;import com.chl.pone.Father;public class ClassNotSamePackage {public void publicMethod(){Father father = new Father();father.publicValue = 1;}}