This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "FizzSwitch and camelCase?" Watch "FizzSwitch and camelCase?" New topic
Author

FizzSwitch and camelCase?

M Marsden
Greenhorn

Joined: Jun 18, 2008
Posts: 18
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
author
Sheriff

Joined: Oct 14, 2002
Posts: 8801
    
    5
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.

hth,

Bert


Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: FizzSwitch and camelCase?
 
Similar Threads
Ambiguity in Kathy Sierra Question
Java Beans Question
JavaBean method names
Chapter 3 question 5 page 279
WA #1.....word association