Weitere ähnliche Inhalte
Ähnlich wie 明日から使える Java SE 7 (20)
Mehr von Yuichi Sakuraba (20)
Kürzlich hochgeladen (11)
明日から使える Java SE 7
- 1. 明日から使える
Java SE 7
Java in the Box
櫻庭 祐一
- 4. なぜ遅れた
Project Lambda
機能 Project Jigsaw
買収
移行 JDK OpenJDK
JavaFX?
- 5. Java SE 7 Themes
Compatibility
Productivity Project Coin
Performance G1GC JSR166y
Universality InvokeDynamic
Integration NIO2
- 7. try-with-resources
+1
try (InputStream in = new FileInputStream(src);
OutputStream out = new FileOutputStream(dest)) {
byte[] buf = new byte[1024];
int n;
while((n = in.read(buf)) >= 0) {
out.write(buf, 0, n);
}
} catch (IOException ex) {
// 例外処理
}
- 8. Multi Catch/Precise Rethrow
+1
try {
DocumentBuilderFactory factory
= DocumentBuilderFactory.newInstance();
DocumentBuilder builder
= factory.newDocumentBuilder();
Document doc = builder.parse(stream);
// パース
} catch (final IOException
| IllegalArgumentException
| ParserConfigurationException
| SAXException ex) {
log(ex);
throw ex;
}
- 9. NIO2 FileVisitor を使ったファイルの検索
+1
Path start = ...;
String regex = ...;
Files.walkFileTree(start, new SimpleFileVisitor<Path>() {
public FileVisitResult visitFile(Path path,
BasicFileAttributes attrs) throws IOException {
if (Pattern.matches(regex,
path.getFileName().toString()) {
System.out.println("File: " + path);
}
return FileVisitResult.CONTINUE;
}
});
- 11. javafx.scene.control.Button button = new Button("OK");
+0.5
EventHandler<ActionEvent> handler = new EventHandler<>() {
public void handle(ActionEvent t) {
// イベント処理
}
};
button.setOnAction(handler);
button.setOnAction(new EventHandler<>() {
public void handle(ActionEvent t) {
// イベント処理
}
});
- 13. 微妙 ...
String Switch
JDBC 4.1
MXBean 拡張
Nimbus L&F
プラットフォーム依存
SCTP/SDP
Unicode 6.0
- 14. なぜなくなった !!
XML リテラル
JSR255 JMX 2.0
JSR296 Beans Binding
JSR303 Bean Validation
JSR274 BeanShell Script Language
JSR260 Javadoc
- 15. なぜなくなった !!
XML リテラル
JSR255 JMX 2.0
JSR296 Beans Binding
JSR303 Bean Validation
JSR274 BeanShell Script Language
コードネーム
もなくなった
JSR260 Javadoc
- 16. Conclusion
全体的に小粒のアップデート
Java SE 8 につながる技術に注目
ファイルを扱うなら NIO2!!
いきなり Java SE 8 はつらいよ
参考
ITpro Java SE 7 徹底理解
- 17. 明日から使える
Java SE 7
Java in the Box
櫻庭 祐一