aspose file tools*
The moose likes Features new in Java 7 and the fly likes whats new? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Features new in Java 7
Bookmark "whats new?" Watch "whats new?" New topic
Author

whats new?

Sam Doder
Ranch Hand

Joined: Feb 06, 2008
Posts: 204
What is new that java 1.7 has that 1.6 doesn't.
Other then the fact they have add some classes / packages.

I am more getting at the language itself?

For example 1.5 / 1.6 has generics , auto boxing , annotations , enums ,...etc but 1.4 doesn't
Is their any thing to the java language that is different or is it just class/packages for this version.

Also did they add any new tools that can't be found in the bin files that are not in java 1.6 or lower or any tools that at all.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19692
    
  20

Sam Doder wrote:For example 1.5 / 1.6 has generics , auto boxing , annotations , enums ,...etc but 1.4 doesn't

Except assertions. But Java 7 didn't add any new language features that I know of. Not even the desired overloading of mathematical overloading for BigInteger and BigDecimal...


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4384
    
    8

Here's a list of the language enhancements. Including...

- Resource management ("try-with-resources"). I can see that being very useful - the equivalent of the using statement in C#.

- Multiple exception catching

- Generic type inference on creation

- Switch on Strings
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19692
    
  20

D'oh! I forgot all about those!
Luke Murphy
Ranch Hand

Joined: May 12, 2010
Posts: 300
What's new? A good blog post here: http://dublintech.blogspot.com/2011/07/java-se-7.html
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38726
    
  23
Number literals in the formats 0b01010101 and 123_456_789 and similar.
Ajay Varma
Greenhorn

Joined: Jun 11, 2011
Posts: 3
Thanks Luke for the link.... really loved some of the new features added in Java 7!!!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41793
    
  62
Not even the desired overloading of mathematical overloading for BigInteger and BigDecimal...

IMO, overloading is one of the more evil features of C++. I sure hope it never makes it into Java in a general way (meaning, where everyone can define what "+" means for class X).


Ping & DNS - my free Android networking tools app
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19692
    
  20

I agree on not letting just anyone overload operators. However, there is already operator overloading for String (+). I don't see any problems adding it to two other numerical classes in the core API. It's already added to the primitive wrappers through boxing/unboxing, so why not for these two?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38726
    
  23
. . . and in this case it would be intuitive. The overloaded + isn't intuitive for Strings.
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3646
    
  16

Personally I think I would enjoy operator overloading. It can greatly increase readability of code. Of course it can and will be widely abused; but the same is true for the sub-typing system. Should Java have gone without inheritance?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41793
    
  62
Inheritance is actually a feature I, for one, rarely use. Interfaces, OTOH, are a great thing.

One feature that was rushed in and caused a lot more problems that it solved (IMO) were the wildcard generics.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38726
    
  23
Was generics rushed in at all? They took their time writing generics, nice and slowly. 9 years too slowly If generics had been available from the start, it would have been based on reification, not erasure, and it would have been easy to understand.
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3646
    
  16

I very rarely use inheritance myself, but was it a mistake to add it to the language, because so many new programmers misuse it?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41793
    
  62
Campbell Ritchie wrote:Was generics rushed in at all?

Not generics - wildcard generics. That was very much a rush job.
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3646
    
  16

What would have been better ways to do them? I've had no problems with wildcards myself.
Scotty Mitchell
Ranch Hand

Joined: Aug 09, 2011
Posts: 46
Arn't closures being supported or something along those lines so we can have anonymous functions work like in other languages that use currying and such? I thought I read that somewhere
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38726
    
  23
Closures not seen yet; they are planned for J8. And that might still not be realised.
Scotty Mitchell
Ranch Hand

Joined: Aug 09, 2011
Posts: 46
Stephan van Hulst wrote:I very rarely use inheritance myself, but was it a mistake to add it to the language, because so many new programmers misuse it?


I'd have to agree with this...I mean I've only been out in the real world for a couple months, and I've never really used inheritance at all. Mostly composition...
Debasish Ray Chawdhuri
Greenhorn

Joined: Feb 05, 2007
Posts: 24
You can read it here, all accumulated. http://www.geekyarticles.com/2011/07/whats-new-in-java-7-project-coin.html


SCJP 1.5, SCWCD 1.4, SCBCD 5.0 It's the attitude, and not the aptitude, that determine one's altitude in life.
Pat Farrell
Rancher

Joined: Aug 11, 2007
Posts: 4655
    
    5

Ulf Dittmer wrote:IMO, overloading is one of the more evil features of C++. I sure hope it never makes it into Java in a general way (meaning, where everyone can define what "+" means for class X).

Actually, operator overloading came from ADA before C++, and may have come from something before ADA. But I agree that it is evil. I don't see it having any value except for numeric data types. I spent ages working on a Money class with proper overloading, and it was never perfect.

I think we'd be better off with language-defined abstract numeric data type that has the usual arithmetic overloads, and let us implement the required functions.

Still, its not clear what the proper meaning of when a is Complex and B is Money.
Stephan van Hulst
Bartender

Joined: Sep 20, 2010
Posts: 3646
    
  16

The same is true for every other function.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: whats new?