Forgot your password?
typodupeerror
Java Oracle

Java 7: What's In It For Developers 338

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."
This discussion has been archived. No new comments can be posted.

Java 7: What's In It For Developers

Comments Filter:
  • by pauljlucas ( 529435 ) on Wednesday August 24, 2011 @11:00PM (#37200896) Homepage Journal
    I assume the author meant, "... to improved file system access." See here [oracle.com].
  • Comment removed (Score:5, Informative)

    by account_deleted ( 4530225 ) on Wednesday August 24, 2011 @11:06PM (#37200946)
    Comment removed based on user account deletion
  • Re:Improvements (Score:4, Informative)

    by Lisandro ( 799651 ) on Thursday August 25, 2011 @01:18AM (#37201742)

    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.

  • by ispeters ( 621097 ) <ispeters@@@alumni...uwaterloo...ca> on Thursday August 25, 2011 @03:02AM (#37202272)

    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 [slashdot.org]: you have no idea what you're talking about.

    Ian

I've never been canoeing before, but I imagine there must be just a few simple heuristics you have to remember... Yes, don't fall out, and don't hit rocks.

Working...