• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question on switch construct

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 580
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi rahul

Thanks for ur interesting code

ya it giving answwer TEN
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic