File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes FizzSwitch and camelCase? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "FizzSwitch and camelCase?" Watch "FizzSwitch and camelCase?" New topic

FizzSwitch and camelCase?

M Marsden

Joined: Jun 18, 2008
Posts: 21
The Sierra/Bates book says it mostly follows camelCase rules and that the SCJP exam will - I was somewhat confused by the sample question in chapter 3 (it's already been posted on these boards, so I'll omit the code). The question defines a class named Fizz containing a static method named FizzSwitch. It was my understanding the method should start lowercase?
Theodore Casser
Ranch Hand

Joined: Mar 14, 2001
Posts: 1902

I wouldn't concentrate so much on that - mostly still allows for a 'slip' now and again. While most methods you'll see written in Java are going to start with a lower-case letter (camel-case), the compiler will accept upper-case letters at the start of methods. It's entirely legal.

Theodore Jonathan Casser
SCJP/SCSNI/SCBCD/SCWCD/SCDJWS/SCMAD/SCEA/MCTS/MCPD... and so many more letters than you can shake a stick at!
Bert Bates

Joined: Oct 14, 2002
Posts: 8898
I can't remember exactly what we were going for with that question, but I can say that sometimes you'll find the code in the real exam questions that doesn't follow normal conventions. The fact is that normal conventions help make code more readable, and sometimes when we write exam questions we don't want to give certain clues to what's going on in the code.

So again, I'm not sure if that was what was going on with this question, but I can say that you might see stuff like this on the real exam.



Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
I agree. Here's the link:
subject: FizzSwitch and camelCase?
It's not a secret anymore!