company.java
来自「This is the inheritance model in java.」· Java 代码 · 共 35 行
JAVA
35 行
package company;
import company.animal.Animal;
import company.animal.feet.*;
import company.animal.nofeet.*;
import company.equipment.*;
import company.Farm;
public class Company {
private String name;
private String type;
public Company (String name, String type) {
this.name = name;
this.type = type;
}
public void setName (String name) {
this.name = name;
}
public void setType (String type) {
this.type = type;
}
public String getName() {
return this.name;
}
public String getType() {
return this.type;
}
public String getInfo() {
String info = "Name: "+this.name+"\n"+
"Type: "+this.type;
return info;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?