This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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: 11150
    
  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
 
Similar Threads
Math.random
Code inside JButton
Math.random().....what is the starting range ad ending range?can we customise the range numbers ?
generating unique Random Numbers
Practical Number?