// File: dice.jsl
// this represents the die; it now implements
// the Rollable interface
public class Dice implements Rollable
{
public Dice(int i)
{
numSides = i;
}
public int sides()
{
return numSides;
}
// number of sides on the die
private int numSides;
}
// File: app.jsl
public class App
{
文章来源于领测软件测试网 https://www.ltesting.net/