○○はじめました。

暇なので新しく趣味を始めてみます。

Java5界から脱出した私のためのJava7紹介

Java SE 7 Features and Enhancements

  • IO and New IO
    • Zip File System Provider
    • java.nio.file
      • ファイル操作はこっちを使うようになる
  • Internationalization
  • java.lang Package
    • Multithreaded Custom Class Loaders in Java SE 7
  • Java Programming Language
    • Binary Literals
      • 0b
      • (byte)0b00100001
    • Strings in switch Statements
      • case に String を取れる!
      • case "Monday":
    • The try-with-resources Statement
      • Closableを実装しているクラスを自動でCloseしてくれる構文
      • try (BufferedReader br = new BufferedReader(new FileReader(path))) {
    • Catching Multiple Exception Types and Rethrowing Exceptions with Improved Type Checking
      • 複数の例外を一発キャッチ
        • catch (IOException|SQLException ex) {
    • Underscores in Numeric Literals
      • 3.14_15F
    • Type Inference for Generic Instance Creation
      • 右辺のジェネリックスを省略できる
      • Map <String、List > myMap = new HashMap <>();
  • java.util.Objects