验证访问控制权限
(1)创建两个包:hnjm.xxgl、hnjm.xxgl.test包
(2)在hnjm.xxgl包中创建一个类Animal,定义一个属性animalType,并封装。该类中定义3个无返回值的方法:第一个方法printAnimalType(),用于输出animalType属性值,使用public修饰;第二个方法shout(),用于描述动物的叫声,不使用任何访问控制修饰符;第三个方法active(),用于描述动物行走,使用protected修饰;
(3)在hnjm.xxgl包中再创建一个类Cat,该类继承Animal类,并定义一个方法zhuoShu(),设置为私有,在主方法中创建Cat对象并调用调用父类和自己的方法,判断是否能全部继承;
(4)在hnjm.xxgl.test包中创建一个类Bird,继承Animal类,并定义一个方法sing(),打印输出“鸟儿在歌唱”;
(5)在hnjm.xxgl.test包定义测试类的名字使用姓名拼音以及作业序号,在主方法中创Bird对象,并调用从Animal继承的方法以及自己的方法,观察父类的方法是否能全部继承。