Can someone help me find the error in my program? When I compile it, it gives the cannot find symbol error. I have been playing around with it for a while but cant seem to grasp my mistake.
My main class:
public static void main(String[] args) {
int plays;
SlotMac machine[] = new SlotMac[3];
machine[0] = new SlotMac(3,35,30);
machine[1] = new SlotMac(10,100,60);
machine[2] = new SlotMac(4,10,9);
plays= firstmachine(machine[0]);
System.out.println(plays);
My other class:
public class SlotMac {
int win_plays, plays;
int times_played;
int quarters;
public SlotMac(int times_played, int win_plays, int quarters) {
this.win_plays= win_plays;
this.times_played= times_played;
this.quarters= quarters;
}
public int firstmachine() {
return plays;
}
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…