apple.java
来自「《Java与模式》一书的源代码」· Java 代码 · 共 27 行
JAVA
27 行
package com.javapatterns.simplefactory;
public class Apple implements Fruit
{
public void grow()
{
System.out.println("Apple is growing...");
}
public void harvest()
{
System.out.println("Apple has been harvested.");
}
public void plant()
{
System.out.println("Apple has been planted.");
}
public int getTreeAge() { return treeAge; }
public void setTreeAge(int treeAge) { this.treeAge = treeAge; }
private int treeAge;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?