好吧,new一个对象出来:'(
class TallRichHandsome{
int salary=10000000;
int tall=188;
String appearance="帅";
public void hasCar(){
System.out.println("有车");
}
public void hasHouse(){
System.out.println("有房");
}
}
class Test{
TallRichHandsome tfs=new TallRichHandsome();
tfs.hasCar();
tfs.hasHouse();
System.out.prinln(tfs.salary+" "+tfs.tall);
} |