class Building {
static int hight;
static String name;
static String color = "silver";
public Building (String name,int hight) {
this.hight = hight;
this.name = name;
}
public static void show(){
System.out.println("名字:"+name+"高度:"+hight);
}
}
class StaticTest {
public static void main(String[] args) {
Building l = new Building("fever",130);
l.show();
System.out.println(Building.color);
Building.show();
}
}
|
|