1.Public:不同包、同一包、类内都可用 2.Private:类内 3.Protected: 不同包的子类、同一包、类内都可用 4.不写时:同一包内、类内 转载于:https://www.cnblogs.com/humf/p/6862710.html