This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Switch Statement using String on OCA 7

 
Glenn Gould
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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'.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic