im using CMD with JDK/Netbeans
this is my code.
class NestedIfSample
{
public static void main(String args[])
throws Exception
{
System.out.println("Enter [A] ADD\n [S]SUB\n[M]MUL\n[D]DIV");
Char choice=(Char)system.read();
if (choice =='A');
case 'S':
System.out.println("Subtracting");
break;
case 'M':
System.out.println("Multiplying");
break;
case 'D':
System.out.println("Dividing");
break;
default:System.out.println("invalid choice");
System.out.println("Statement after the switch");
}
}
the error says
orphaned error
on case 'S':
ve tried alot but im so new at this. i dont have any experience on programming before i hope someone could help
thanks
This post has been edited by macosxnerd101: 23 June 2011 - 06:01 AM
Reason for edit:: Added code tags and renamed title to be more descriptive

New Topic/Question
Reply



MultiQuote








|