Dollar
このコードでは、クラスを別のファイルに移動したいと思い.java
ます。次に、このファイルにどのようなインポート ステートメントを追加する必要がありますか? を調整する必要がありCLASSPATH
ますか? 私はMac OS Xで作業しています。
import org.junit.Test;
import static org.junit.Assert.*;
public class TestDollar
{
class Dollar
{
int amount;
Dollar(int amount)
{
}
void times(int multiplier)
{
}
}
public void testMultiplication()
{
Dollar five = new Dollar(5);
five.times(2);
assertEquals(10, five.amount);
}
}