Slashdot Mirror


Java 7: What's In It For Developers

GMGruman writes "After five years of a torturous political process and now under the new ownership of Oracle, Java SE 7 is finally out (and its initial bugs patched in the Update 1 release). So what does it actually offer? Paul Krill surveys the new capabilities that matter most for Java developers, from dynamic language support to an improved file system."

4 of 338 comments (clear)

  1. Re:A language with a file system? by pauljlucas · · Score: 2, Informative

    I assume the author meant, "... to improved file system access." See here.

    --
    If you reply, do so only to what I explicitly wrote. If I didn't write it, don't assume or infer it.
  2. Re:A language with a file system? by iggymanz · · Score: 5, Informative

    It's just improvements to the I/O API. Java has the New IO API for doing I/O. java 7 has extended it, hence NIO2. http://www.ibm.com/developerworks/java/library/j-nio2-1/?ca=drs-

  3. Re:Improvements by Lisandro · · Score: 3, Informative

    To be fair here compared to other interpreted languages Java is still the king of the hill. By far.

    Disclaimer: Yes, interpreted. Bytecode is interpreted, even with stuff like JIT.

  4. Re:Devs can now be more lazy by ispeters · · Score: 3, Informative

    Are you trolling? You said:

    There has got to be a performance hit for "extending" garbage collection to files, sockets, and databases. How hard is it to realise you no longer need a resource and free it.

    They haven't "extended garbage collection", they've introduced syntactic sugar. Instead of this (with real indenting in real life because you're not limited by Slashdot's lame commenting system):

    File file = null;

    try {
    file = openAFile();

    // operate on file, possibly causing an exception
    }
    catch (IOException e) {
    // do whatever you like with e, possibly rethrowing
    }
    finally {
    if (file != null) {
    try {
    file.close();
    }
    catch (IOException e) {
    // what the hell do you do here?
    }
    }
    }

    You can have something like this:

    try (File file = openAFile()) {
    // operate on file, possibly causing an exception
    }
    catch (IOException e) {
    // do whatever you like with e, possibly rethrowing
    }

    // file is closed here because the compiler has inserted
    // the right epilogue for you, saving you boilerplate, preventing
    // you from inserting the wrong boilerplate, and not impacting
    // the GC in the slightest

    So either you're trolling or "The Dawn Of Time" is right: you have no idea what you're talking about.

    Ian