This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Java in General and the fly likes Problem in my switch case Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Problem in my switch case" Watch "Problem in my switch case" New topic
Author

Problem in my switch case

Marianne Hathaway
Greenhorn

Joined: Mar 04, 2013
Posts: 5
hi guys...please. check this one.. I'm new to java and I need some help in here. I'm have a problem with this:


My problem is: If I only choose Budget Meal ...that Regular Meal is also showing.. and I can't choose. please help me. Im all messed up. I cant think of any solution. My codes are always showing whichever I choose. You can ask me if you're kinda confused

Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 2248
    
  47
Welcome to the Ranch.

Please UseCodeTags (← click) when posting code as it makes it easier for people to read your code. I've added them for you this time.
Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 2248
    
  47
Your if statements both have semi-colons after them so the following code block is not part of the if statement and will always get executed.
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3456
    
  12
Tony Docherty wrote:Your if statements both have semi-colons after them so the following code block is not part of the if statement and will always get executed.

Well spotted.


Joanne
Marianne Hathaway
Greenhorn

Joined: Mar 04, 2013
Posts: 5
thanks....I'm sorry for that code tag thing...^_^. I dont know the rules ,eh.
Marianne Hathaway
Greenhorn

Joined: Mar 04, 2013
Posts: 5
Marianne Hathaway wrote:hi guys...please. check this one.. I'm new to java and I need some help in here. I'm have a problem with this:


My problem is: If I only choose Budget Meal ...that Regular Meal is also showing.. and I can't choose. please help me. Im all messed up. I cant think of any solution. My codes are always showing whichever I choose. You can ask me if you're kinda confused

Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 2248
    
  47
I've already told you what is wrong with your code, please see my earlier post. If you don't understand my earlier answer please ask for clarification don't just post the same question again.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in my switch case