package liu0917; public class Cat
{
String name="妮妮";
int age=2;
String maose="灰色";
void mao()
{
System.out.println("cat的姓名是:"+name); }
void hanjiao()
{
System.out.println("喵喵");
}
}
package liu0917; public class Catmao { public static void main(String[] args) {
Cat ca=new Cat(); System.out.println("cat的毛色:"+ca.maose); System.out.println("cat的年龄:"+ca.age); ca.hanjiao();
ca.mao(); } }