TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Java 7 : The new try-with-resources statement

17 点作者 budu超过 14 年前

5 条评论

mahmud超过 14 年前
This is what happens when people aren't given UNWIND-PROTECT and DEFMACRO: a cottage industry of pundits and legislators will form to discuss any itches you might have, and whether to scratch them.<p>Watching Java programmers is like having a tribal shaman for a next-door neighbor. You know it's none of your business, and you respect his beliefs, but it's still unsettling to see him do one of those "hot knife in nose" and "pull stubborn goat with nipple fish-hook" rituals.<p>Come to think of it, that last trick must be what Guy Steele did to drag C++ programmers "halfway to Lisp".
评论 #1634249 未加载
ataggart超过 14 年前
<p><pre><code> (with-open [fis (FileInputStream. source) fos (FileOutputStream. target)] (do-stuff fis fos)) </code></pre> I wish they would spend less time adding stuff to the Java language (especially features present in other JVM languages), and more time fixing the core API and improving the JVM feature set. Continuations would be nice.
Tichy超过 14 年前
"java.lang.AutoCloseable interface"<p>Facepalm... (There has to be an easier way...)
评论 #1632721 未加载
评论 #1631526 未加载
fxtxrx超过 14 年前
Is this similar to C#/.NET "using" construct ?
评论 #1631590 未加载
nradov超过 14 年前
Well sure it will help a little, but if only they would add control flow closures then we could write these constructs ourselves rather than having to build them into the core language.