public class Cource ...{
private String name; // name of cource
private int[] par; // the par for each hole
/**//*
* Set the name of the course
*/
public void setName(String name) ...{
this.name = name;
}
/**//*
* Set the par for the cource
*/
public void setPar(int[] par) ...{
this.par = par;
}
/**//*
* Get the number of holes for the course
*/
public int getNumberOfHoles() ...{
return par.length;
}
文章来源于领测软件测试网 https://www.ltesting.net/