')' expected error

Hello,

i am receiving this error when i am compiling my class, and i cannot find any missing parentheses. can someone help?

switch(menuSelection)

{

case 1:

System.out.println("Selection 1: \n2(8 ounce) packages cream cheese" +" \n3/4 cup white sugar " +"\n1 (15 ounce) can pumpkin puree" +"\n1 1/4 teaspoons ground cinnamon" +"\n1/2 teaspoon ground ginger" +"\n1/2 teaspoon ground nutmeg" +"\n2 eggs" +"\n1/4 teaspoon salt" +"\n2 prepared 8 inch pastry shells");

yummyCake.yummy(cakeType);

break;

case 2:

System.out.println("Selection 2: \n1/3 cup vegetable oil" +"\n2 squares unsweetened chocolate""\n3/4 cup water" +"\n1 cup sugar" +"\n1 1/4 cups all-purpose flour" +"\n1/2 teaspoon salt" +"\n1/2 teaspoon baking soda" ="\n1 teaspoon vanilla" +"\n1 cup semisweet chocolate chips" +"\n1/3 cup chopped pecans");

yummyCake.yummy(cakeType);

break;

case 3:

System.out.println("Selection 3: \n2 tablespoons butter" +"\n1/4 cup light brown sugar" +"\n1 cup fruit cocktail, drained" +"\n1 cup sifted cake flour" +"\n1 teaspoon baking powder" +"\n1/4 teaspoon salt" +"\n4 eggs, separated" +"\n1 cup granulated sugar" +"\n1/4 cup cold water" +"\n1 teaspoon vanilla");

yummyCake.yummy(cakeType);

break;

case 0:

System.out.println("Selection 0");

dyummyCake.yummy(cakeType);

break;

}

[2525 byte] By [jimuna25a] at [2007-11-26 21:29:29]
# 1

If you are sure that the error is in that class reduce it until it works then start adding things in slowly until you get an error. That way you don't rely on anyone else, and more importantly you will notice the error and be less likely to make it yourself (At least that works for me )

*Note* also writing the actual error helps out immensly. They didn't write out different errors for everything just for you to write "It gave an error." Those errors mean something.

Aknibbsa at 2007-7-10 3:09:56 > top of Java-index,Java Essentials,New To Java...
# 2
dyummyCake.yummy(cakeType); maybe?
hunter9000a at 2007-7-10 3:09:57 > top of Java-index,Java Essentials,New To Java...
# 3
If the error indicates the switch statement as the culprit, it may be caused by something before the switch. If you forgot a closing ) before switch, the compiler expects to find one, but it gets a switch instead, so it says it expected one on that line.
hunter9000a at 2007-7-10 3:09:57 > top of Java-index,Java Essentials,New To Java...
# 4
You have = instead of + in case 2, you are also missing a +Chances are, that's your problem (assuming you copy+pasted your code here).It says ")" expected because it expects to find that ) after the end of the String.
ignignokt84a at 2007-7-10 3:09:57 > top of Java-index,Java Essentials,New To Java...
# 5

thanks, i fixed that error, now i am getting another one further up. i might as well post the entire code, which isnt a lot. there error now says "cannot find symbol class cake". Below the initial code is my class.

public class Rogers_Jim_Cakes_Methods {

public static void main(String [] args) {

int input;

int cake;

int cakeType;

int menuSelection;

cake yummyCake = new cake();

//System.out.println("0. Exit");

//int menuSelection = System.inInt();

//System.out.println(menuSelection);

do

{

System.out.println("Cake Menu");

System.out.println(".......................");

System.out.println("1. Pumpkin Cheesecake");

System.out.println("2. Easy Chocolate Snack Cake");

System.out.println("3. Fruit Cocktail Upside Down Cake");

System.out.println("0. Exit");

System.out.println("Please select a cake number or enter 0 to exit: ");

//menuSelection = input.nextInt();

cakeType=menuSelection;

switch(menuSelection)

{

case 1:

System.out.println("Selection 1: \n2(8 ounce) packages cream cheese" + " \n3/4 cup white sugar " + "\n1 (15 ounce) can pumpkin puree" + "\n1 1/4 teaspoons ground cinnamon" + "\n1/2 teaspoon ground ginger" + "\n1/2 teaspoon ground nutmeg" + "\n2 eggs" + "\n1/4 teaspoon salt" + "\n2 prepared 8 inch pastry shells");

yummyCake.yummy(cakeType);

break;

case 2:

System.out.println("Selection 2: \n1/3 cup vegetable oil" + "\n2 squares unsweetened chocolate" + "\n3/4 cup water" + "\n1 cup sugar" + "\n1 1/4 cups all-purpose flour" + "\n1/2 teaspoon salt" + "\n1/2 teaspoon baking soda" + "\n1 teaspoon vanilla" + "\n1 cup semisweet chocolate chips" + "\n1/3 cup chopped pecans");

yummyCake.yummy(cakeType);

break;

case 3:

System.out.println("Selection 3: \n2 tablespoons butter" + "\n1/4 cup light brown sugar" + "\n1 cup fruit cocktail, drained" + "\n1 cup sifted cake flour" + "\n1 teaspoon baking powder" + "\n1/4 teaspoon salt" + "\n4 eggs, separated" + "\n1 cup granulated sugar" + "\n1/4 cup cold water" + "\n1 teaspoon vanilla");

yummyCake.yummy(cakeType);

break;

case 0:

System.out.println("Selection 0");

yummyCake.yummy(cakeType);

break;

}

}while (menuSelection!=0);

System.out.println("Adios, you fat bastard!");

}

}

Code for class:

public class Rogers_Jim_Cakes {

public void Cakes() {

}

public void yummy(int cakeToMake){

System.out.println("Cake Made." + cakeToMake);

}

}

jimuna25a at 2007-7-10 3:09:57 > top of Java-index,Java Essentials,New To Java...
# 6

You've got a couple of problems with those literals:

1. You need to check carefully where those '" + " ' combinations are ... you

will need to correct a couple of them.

2. There is no need to add the Strings the way you are doing. Instead of

adding them up, make them on continuous String Object.

"Selection 3: \n2 tablespoons butter" + "\n1/4 cup light brown sugar" + "\n1 cup fruit cocktail, drained" + "\n1 cup sifted cake flour" + "\n1 teaspoon baking powder" + "\n1/4 teaspoon salt" + "\n4 eggs, separated" + "\n1 cup granulated sugar" + "\n1/4 cup cold water" + "\n1 teaspoon vanilla"

-becomes-

"Selection 3: \n2 tablespoons butter\n1/4 cup light brown sugar\n1 cup fruit cocktail, drained\n1 cup sifted cake flour\n1 teaspoon baking powder\n1/4 teaspoon salt\n4 eggs, separated\n1 cup granulated sugar\n1/4 cup cold water\n1 teaspoon vanilla"

Unless you want to break it up into separate lines, that is.

OPPS too late ... about the cake thing - you've got it declared as an int (primitive / atomic variable type), and then try to define it as an Object.

abillconsla at 2007-7-10 3:09:57 > top of Java-index,Java Essentials,New To Java...
# 7
Your error message tells you EXACTLY what the problem is - you have no "cake" class.
ignignokt84a at 2007-7-10 3:09:57 > top of Java-index,Java Essentials,New To Java...
# 8
sorry if i sound like a retard, but my teacher sucks and im totally lost in this ****.
jimuna25a at 2007-7-10 3:09:57 > top of Java-index,Java Essentials,New To Java...