Os:windows7 x64
Jdk:jdk-8u131-windows-x64
Ide:eclipse Oxygen Release (4.7.0)
Code One:
Package Jizuiku;class person {void Showdefault () {System.out.println ("Showdefault");} private void Showprivate () {System.out.println ("showprivate");} protected void showprotected () {System.out.println ("showprotected");} public void Showpublic () {System.out.println ("Showpublic");}}
Code two:
Packages Jizuiku;class Demo {public static void main (string[] agrs) {person p = new person ();//unrelated class under the same package. Demo and person is not an inheritance relationship//can access to the default/protected/public Method P.showdefault ();p. showprotected ();p. Showpublic ();}}
Results:
Java is good, worth learning.
Learning resources: Itcast Video Library. If you have public resources, can share to me, with your resources to learn also can.
Blog post is to watch the video, into thinking written. It's good that the teacher speaks well. Blog bad, is to give the most bitter not serious.
If you think the blog can be improved, leave a message.
JavaSE8 base the unrelated classes under the same package can access the default/protected/public methods