Meaningless Drivel is fun!*
The moose likes Associate Certification (SCJA,OCAJ 5/6) and the fly likes Switch Statement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Associate Certification (SCJA,OCAJ 5/6)
Bookmark "Switch Statement" Watch "Switch Statement" New topic
Author

Switch Statement

Atah Tabotnjap
Greenhorn

Joined: Mar 17, 2008
Posts: 21
Hi guys

I have tried to compile and run this small class, but i only get 2 errors:

public class SwitchCheck {
public static void main(String[] args) {
int i = 4;
switsch (i) {
default: System.out.print("default");
break;
case 1: System.out.print("1 ");
break;
case 2: System.out.println("2");
break;
}
}
}

What should i expect ?

Thanks in advance
Hiremath Patil
Greenhorn

Joined: Sep 19, 2008
Posts: 1
Hi

Check spelling of "switsch" .
It should be switch

Thanks
Hiremath
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

The first problem is probably triggering the second. Don't hesitate to post the actual error messages when you're stuck!

-Cameron McKenzie
Atah Tabotnjap
Greenhorn

Joined: Mar 17, 2008
Posts: 21
Thanks.

That was easy. couldn't see it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Switch Statement
 
Similar Threads
switch case basic
Unreachable statement
Numeric value convert to word format
Do while error, I'm going crazy
dan's control flow questions