⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fishingnet.java

📁 This is the inheritance model in java.
💻 JAVA
字号:
package company.equipment;

public class FishingNet extends Equipment{

	private double lenght;
	private double width;
	private double maxWeight;
	
	public FishingNet(String type,String brand,double lenght,double width,double maxWeight){
		super(type,brand);
		this.lenght = lenght;
		this.width = width;
		this.maxWeight = maxWeight;		
	}
	public void setLenght(double lenght){
		this.lenght = lenght;
	}
	public void setWidth(double width){
		this.width = width;
	}
	public double getLength() {
	         return this.lenght;
			 }
	public double getWidth() {
             return this.width;
             }			 
	public String getInfo(){
		String info = "\n"+"\n"+"Fishing Net"+"\n"+"Type: " + super.getType() + "\n" +
					  "Brand: " + super.getBrand() + "\n" +
					  "Lenght: " + this.lenght + "\n" +
					  "Width: " + this.width + "\n" +
					  "MaxWeight: " + this.maxWeight + "\n";					  ;
		return info;
	} 
	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -