• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Switch

 
Bryan Snipes
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm back... that didn't take long!
I am taking an online course as well as using the Head First Java book. The online course discusses the Switch statement, but the book doesn't. Is the Switch something that is now outdated? Or was it put into the language after the book was published? Just need to know if this is something I should spend time learning.
 
Richard Chambers
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My textbook is based on 1.5, and I use 1.6

We covered Switch, and I've used it in course projects.

Not hard to learn, 10 or 15 minutes and you'll have it.
 
Bryan Snipes
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks! I've been programming for over 11 yrs. (just not Java), so I have seen similar types of statements. I was curious as to why the book didn't cover it (or why the course did).
 
Campbell Ritchie
Sheriff
Pie
Posts: 49796
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch, "j rookie"

You would appear to have missed the naming policy on your way in, which requires a first name, space, second name, neither obviously fictitious. Please go to your profile using the above link and correct your displayed name to comply.
 
Campbell Ritchie
Sheriff
Pie
Posts: 49796
69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The switch block is still in common use, maybe less so if you use Swing because you can have on-screen menus rather than text menus.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic