Help - Syntax error on token "=", Name expected after token
843785Oct 19 2008 — edited Oct 19 2008On line of my code I get the error message "Syntax error on token "=", Name expected after token" and I am not able to figure out why for sure. Also, when I run the program, after the question about number of scoops the box with choices is then showing the original flavors 2 times instead of the choices for number of scoops. Can anyone help me with why this is all happening? Thanks!
<code>
import javax.swing.*;
public class IceCreamCone
{
protected String[] flavorChoice = {"Vanilla",
"Chocolate", "Strawberry", "Rainbow Sherbert"};
private String menu = "";
private int choice;
protected String[] scoopChoice = ("One Scoop", "Two Scoops", "Three Scoops");
private String menu2 = "";
private int scoops;
public String displayFlavorChoice()
{
for(int x = 0; x < flavorChoice.length; ++x)
{
menu = menu + "\n" + (x + 1) + " for " +
flavorChoice[x];
}
String input = JOptionPane.showInputDialog(null,
"Type your selection for flavor of ice cream, then press Enter." + menu);
choice = Integer.parseInt(input);
return(flavorChoice[choice - 1]);
}
public String displayScoopChoice()
{
for(int y = 0; y < scoopChoice.length; ++y)
{
menu2 = menu2 + "\n" + (y + 1) + " for " +
scoopChoice[y];
}
String input = JOptionPane.showInputDialog(null,
"Type in the number of scoops you would like to order, then press Enter." + menu2);
scoops = Integer.parseInt(input);
return(scoopChoice[scoops - 1]);
}
}
<code>