File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Associate Certification (OCAJP 7/8) and the fly likes Switch Statement using String on OCA 7 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Associate Certification (OCAJP 7/8)
Bookmark "Switch Statement using String on OCA 7" Watch "Switch Statement using String on OCA 7" New topic
Author

Switch Statement using String on OCA 7

Glenn Gould
Greenhorn

Joined: Jul 09, 2013
Posts: 5
The following program compiles from the command prompt and uses the String object in the switch statement.


Question : Has anyone that has taken the exam seen the String object used with the switch statement?
Brandon Mikel
Greenhorn

Joined: Jun 18, 2013
Posts: 3
Most definitely. I only recall one example (took it yesterday). It was something like:




And then it asked what the output would be. Apologies if I've got any syntax wrong, I just threw that together.

The output in this case would be:
"Not a fish at all"
Due to the case of the string blah, which is all lower-case, while the "Tuna" case has a capital 'T'.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Switch Statement using String on OCA 7