Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question on switch construct

 
Rahul Bhosale
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 580
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi rahul

Thanks for ur interesting code

ya it giving answwer TEN
 
ashok kumar
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi raghul,
yes it will compile we can give final variable for the case values every variable inside the interface is public static final.so it will compile.
 
Tony Morris
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic