Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Beginning Java and the fly likes use case for a range of numbers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "use case for a range of numbers" Watch "use case for a range of numbers" New topic
Author

use case for a range of numbers

M Mangion
Greenhorn

Joined: Jun 06, 2011
Posts: 11
Hi

Is it possible to use a case statement for a range of numbers?

fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11880
    
  18

i would go for an if-else


There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Dale Suesse
Greenhorn

Joined: Jun 13, 2011
Posts: 1
The Java switch statement does not support booleans (therefore no ranges). Use an if...else... instead.
M Mangion
Greenhorn

Joined: Jun 06, 2011
Posts: 11
Thank you very much for your help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: use case for a range of numbers
 
It's not a secret anymore!