foo.java

来自「一个短小但实用的junit测试示例,适合初学者」· Java 代码 · 共 24 行

JAVA
24
字号
public class Foo {

	private int[] array;

    public Foo(int size) {
	    array= new int[size];
	}

	public String getHelloWorld() {
		return  "Hello World";
	}

	public boolean getTruth() {
	    return true;
	}

	public void setElement(int position, int value) throws ArrayIndexOutOfBoundsException {
		array[position] = value;
	}

	public int getElement(int position) throws ArrayIndexOutOfBoundsException {
	    return array[position];
	}
}

⌨️ 快捷键说明

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