Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
nradov
on Feb 5, 2010
|
parent
|
context
|
favorite
| on:
All variables in Java must be final
You can't do that. It would require a language change, to make try/catch blocks expressions.
eldenbishop
on Feb 5, 2010
|
next
[–]
You can sort of do this in Groovy.
def val = {try { 1 } catch(ex) { 2 }}.call() assert(1 == val)
twir
on Feb 5, 2010
|
prev
[–]
Heh, I didn't think so. ;)
Consider applying for YC's Winter 2027 batch!
Applications
are open till November 2.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: