aspose 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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 10906
    
  12

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
 
Similar Threads
Code inside JButton
Practical Number?
Math.random().....what is the starting range ad ending range?can we customise the range numbers ?
Math.random
generating unique Random Numbers