The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Question on switch construct 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 "Question on switch construct" Watch "Question on switch construct" New topic

Question on switch construct

Rahul Bhosale
Ranch Hand

Joined: Mar 10, 2005
Posts: 77

Please give a chance for those who are going to take this exam. thanks a ton.

BTW, Moderators/Administrators : Is it ok to post questions that i've already solved but thought it would benefit others?

vidya sagar
Ranch Hand

Joined: Mar 02, 2005
Posts: 580
Hi rahul

Thanks for ur interesting code

ya it giving answwer TEN
ashok kumar
Ranch Hand

Joined: Feb 28, 2005
Posts: 30
hi raghul,
yes it will compile we can give final variable for the case values every variable inside the interface is public static it will compile.
Tony Morris
Ranch Hand

Joined: Sep 24, 2003
Posts: 1608
This is yet another case of confusing a constant with a final (YACOCAFWAC? - that sounds bad now, doesn't it?).
It is a constant, that's why it compiles. It is a final, by consequence.
Seems like these SCJP books provide more confusion than anything.

I'm hangin' around here because I'm waiting for 310-055 (no, not the beta) - any news yet? Cripes, it was "Spring 2005" last I checked, and that was for the northern hemisphere. It's getting pretty dang cold around here. Slipped the deadline, sure, happens all the time... but when can we expect an exam release?

Tony Morris
Java Q&A (FAQ, Trivia)
I agree. Here's the link:
subject: Question on switch construct
It's not a secret anymore!