代码拉取完成,页面将自动刷新
public class RedCowForm {
static String fromName;
RedCow cow;
RedCowForm() {
}
RedCowForm(String s) {
cow = new RedCow(150,112,5000);
fromName = s;
}
public void showCoeMess() {
cow.speak();
}
static class RedCow {//内部类
String cowName = "红牛";
int height, weight, price;
RedCow(int h, int w, int p) {
height = h;
weight = w;
price = p;
}
void speak() {
System.out.println("偶是" + cowName + "身高:" + height + "cm 体重" + weight + "kg,生活在" + fromName);
}
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。