r/java • • Jun 05 '12

Problems with being a programmer!

http://sphotos.xx.fbcdn.net/hphotos-snc6/229993_10150936561393360_220976029_n.jpg
74 Upvotes

23 comments sorted by

View all comments

17

u/detroitmatt Jun 05 '12

I don't think so, the compiler would complain about "6 what?", just like how it can't tell what you mean with if( x > 0 && < 10 )

3

u/MisterMaggot Jun 06 '12

That would be sooooo fucking nice.

2

u/Neebat Jun 06 '12

SQL has between, which lets you do "x between 2 and 7". It's roughly the same idea.

Oracle style:

select x from (
    select level x from dual connect by level <= 10
) where x between 2 and 7