650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M01/82/2E/wKioL1dNmemiIxJeAAAwTXZXC58621.png "title=" Java permissions scope. png "alt=" Wkiol1dnmemiixjeaaawtxzxc58621.png "/>
The point here is that the permissions of the default and Protection permissions (protected) are categorized in detail, and the parent and subclass packages differ.
To: direct the handle class into the other package (friendly is the default permission)
650) this.width=650; "src=" Http://my.csdn.net/uploads/201205/22/1337652149_2109.png "alt=" 1337652149_2109.png "/ >
The test is as follows: Note: Where the test class is the testing class, the package is the current package
Project Catalog:
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/82/30/wKiom1dNohOxxIDFAABla5xwqQk743.png "style=" float: none; "title=" directory. png "alt=" Wkiom1dnohoxxidfaabla5xwqqk743.png "/>
Test of the Animal class
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/82/30/wKiom1dNohXBFlciAABN_7wCajc091.png "title=" the same package class, No parent-child relationship. png "style=" Float:none; "alt=" Wkiom1dnohxbflciaabn_7wcajc091.png "/>
Testing for Cat Classes
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/82/2E/wKioL1dNoxGzb36VAAA8yBGGbOs446.png "style=" float: none; "title=" Untitled. png "alt=" Wkiol1dnoxgzb36vaaa8ybggbos446.png "/>
Test of the Person3 class
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/82/2E/wKioL1dNoxHgCwCdAAA521zXPko440.png "title=" Untitled 2.png "style=" Float:none; "alt=" Wkiol1dnoxhgcwcdaaa521zxpko440.png "/>
Test of the Cat2 class
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/82/30/wKiom1dNohTBeAoYAAA26VsHH3E692.png "style=" float: none; "Title=" Untitled 1.png "alt=" Wkiom1dnohtbeaoyaaa26vshh3e692.png "/>
Test of the Person class
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/82/2E/wKioL1dNoxLBZbFWAAA8EvQUJO8304.png "style=" float: none; "Title=" Untitled 4.png "alt=" Wkiol1dnoxlbzbfwaaa8evqujo8304.png "/>
Test of the Person1 class
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/82/30/wKiom1dNohSQFkhcAAAxmnEawg4694.png "title=" Untitled 3.png "style=" Float:none; "alt=" Wkiom1dnohsqfkhcaaaxmneawg4694.png "/>
Learning notes the valid range of permissions in--java