File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 11499
    
  16

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