numSides = i;
}
public int sides()
{
return numSides;
}
private int numSides;
}
// File: rollable.jsl
// the interface representing a die
interface Rollable
{
public int sides();
}
// File: dicefactory.jsl
// this class handles the creation of dice
public class DiceFactory
{
public static Rollable create(int i)
{
文章来源于领测软件测试网 https://www.ltesting.net/