| | |
New to java I need help with switch case error
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
You have two curly bracklets on start of switch statement and only one on closing
so delete one.
However once this done there is another 13 error messages which you need to sort. GL
Java Syntax (Toggle Plain Text)
switch (sCode){ { case 'c': case 'C':
However once this done there is another 13 error messages which you need to sort. GL
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
•
•
Join Date: Sep 2007
Posts: 2
Reputation:
Solved Threads: 0
•
•
•
•
I am new to Java and can not figure out why I am getting this error for swithc case.
Thanks a bunch
•
•
Join Date: Apr 2006
Posts: 164
Reputation:
Solved Threads: 10
The code you have given have following problems:
1. There is no java object type called "character". Might be you wanted "Character".
2. You have not defined what is "input" variable on line 28.
3. You have not defined "temp", "cel", "df" before you used them. You can not initiate them whenever you want. (Happened for "df")
4. This whole line has formatting error:
5. What is "fht"?????????????
Please fix these problems first, the program should work. (I am wondering how did you get any kind of output.. the code should not compile even)... Good luck..
1. There is no java object type called "character". Might be you wanted "Character".
2. You have not defined what is "input" variable on line 28.
3. You have not defined "temp", "cel", "df" before you used them. You can not initiate them whenever you want. (Happened for "df")
4. This whole line has formatting error:
Java Syntax (Toggle Plain Text)
JOptionPane.showMessageDialog(null, (cel + " degrees in Celsius is " + df.format (f) + " degrees in Fahrenheit." "ConvertTemp05");
Please fix these problems first, the program should work. (I am wondering how did you get any kind of output.. the code should not compile even)... Good luck..
A Perfect World
![]() |
Similar Threads
- error coding switch (C)
- switch statement on String in Java (Java)
- switch case (C)
- Switch Case Options (C#)
- Help with switch/case statement navigation (PHP)
- Switch logic error (C++)
- Switch Case Statement (Java)
- switch/case statement (C++)
Other Threads in the Java Forum
- Previous Thread: simple call
- Next Thread: Interface Expected Error
| Thread Tools | Search this Thread |
2dgraphics android api apple applet application arguments array arrays automation banking binary binarytree bluetooth capture chat chatprogramusingobjects class classes client code color component count database derby design eclipse eclipsedevelopment encryption error event exception fractal game givemetehcodez graphics gridlayout gui html ide if_statement image input integer interface j2me java javadesktopapplications javaprojects jlabel jni jpanel julia keyword linux list loop macintosh map method methods midlethttpconnection mobile netbeans newbie object os print printing problem producer program programming project projectideas read recursion reference replaysolutions ria scanner screen server set size sms sort sourcelabs sql stop string swing threads transforms tree ui unicode validation windows






