jdk7-relnotes

S

Stefan Ram

markspace said:
"The following example, which is valid in Java SE 7 and later,
eliminates the duplicated code:
catch (IOException|SQLException ex)

And we already had the »&« for types as in

class Alpha< T extends Beta & Gamma, S extends Delta & Epsilon > ...

. So now, somebody should come up with a general
theory of conjunction and disjunction types. ;-)

For example, one then might use (for suitable types)

catch( S|T ex ) ...

after the above class head, which can be though of as

catch( Beta&Gamma|Delta&Epsilon ex ) ...
 
T

Travers Naran


Saves me a lot of if-else typing in a few situations. Feels "wrong"
somehow; like somehow, somewhere, C purists are crying. :)

A very irritating minor annoyance is dead... Finally (pun intended). ;-)

The nio2 library is kind of interesting too.
 
G

Gene Wirchenko

Saves me a lot of if-else typing in a few situations. Feels "wrong"
somehow; like somehow, somewhere, C purists are crying. :)

Someday, switch may be as powerful as COBOL's evaluate. I really
have been spoiled by xBASE's do case statement. It is so useful to be
able to use full expressions for cases.

[snip]

Sincerelyk,

Gene Wirchenko
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top