9 Replies - 9832 Views - Last Post: 20 January 2014 - 10:27 AM Rate Topic: -----

#1 Ryano121  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1362
  • View blog
  • Posts: 3,002
  • Joined: 30-January 11

[Link] Everything about Java 8

Post icon  Posted 02 September 2013 - 08:07 AM

*
POPULAR

This article goes into detail about pretty much all the new features in Java 8. It might just be me but good information about it seems to be few and far between at the moment. It's a bit old now but the author does manage to explain everything well.

I think I'm actually looking forward to a new Java release for once :P/>/>

http://www.techempow...g-about-java-8/

Is This A Good Question/Topic? 5
  • +

Replies To: [Link] Everything about Java 8

#2 farrell2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 823
  • View blog
  • Posts: 2,533
  • Joined: 29-July 11

Re: [Link] Everything about Java 8

Posted 02 September 2013 - 08:57 AM

What's really interesting is the default methods for interfaces. Concrete implementations in an interface...who would have thought...

public interface A {
    void compute();

    default void foo() {
        System.out.println("I hate when people use foo in examples");
    }
}

public interface B {
    default void foo() {
        System.out.println("I hate when people use foo in examples");
    }
}

public class Example implements A, B {
    public void foo() {
        System.out.println("Example classs implementation.");
    }
}



It looks like we can still call the default implementations, if we like:

A.default.foo();
B.default.foo();


Was This Post Helpful? 0
  • +
  • -

#3 Ryano121  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1362
  • View blog
  • Posts: 3,002
  • Joined: 30-January 11

Re: [Link] Everything about Java 8

Posted 02 September 2013 - 09:01 AM

Yeah it's pretty much as close as you can get to multiple inheritance without being able to do extends Foo, Bar
Was This Post Helpful? 0
  • +
  • -

#4 farrell2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 823
  • View blog
  • Posts: 2,533
  • Joined: 29-July 11

Re: [Link] Everything about Java 8

Posted 02 September 2013 - 09:12 AM

Now it would really be nice is to see explicit interface implementations like with c#. It seems like no matter what Oracle does, c# is always a step ahead of Java.
Was This Post Helpful? 0
  • +
  • -

#5 Ryano121  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1362
  • View blog
  • Posts: 3,002
  • Joined: 30-January 11

Re: [Link] Everything about Java 8

Posted 02 September 2013 - 09:22 AM

To me we're now up to .NET 3.5 from 2007 :P
Was This Post Helpful? 0
  • +
  • -

#6 Curtis Rutland  Icon User is online

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4462
  • View blog
  • Posts: 7,776
  • Joined: 08-June 10

Re: [Link] Everything about Java 8

Posted 03 September 2013 - 09:19 AM

I read the article a few days ago, and I have to say, I'm glad that they're adding some things, but I wish they would have done some of them differently. Lambdas are just window dressing over a single-method anonymous classes. Type inference is still weak (better, but weak, and the article even says it doesn't know how much of it will be implemented).

But it's really good that they're adding some quality-of-life stuff. Java's basically getting LINQ. That's nice, but you still have some clunky methods like mapToInt where as in C# we just select, and the type is inferred. I guess that's the difference from having actual primitives and not (c# doesn't have primitives, and no interface or shared base that makes numeric types similar, so they have to use extension methods for concrete collections rather than generics).

I do like that you can pass a reference to a constructor as a method reference. That's pretty cool, and it's a feature I don't think has an equal in C#.

I imagine that the java.time is nice, but I wouldn't know. The .NET DateTime was functional out of the box, so I've never had to find a better time lib. I've heard that java's built in dates and times were a pain, but I've never had any experience so I can't comment. Bad enough that they had to include a new API, I guess.

Really, Java moves forward like a snail through sand, but I know a lot of people like that about it. Personally I like languages that evolve quickly. But it's good that Java is moving towards the same goal that C# and .NET is: adding functional aspects.
Was This Post Helpful? 0
  • +
  • -

#7 cfoley  Icon User is online

  • Cabbage
  • member icon

Reputation: 1949
  • View blog
  • Posts: 4,048
  • Joined: 11-December 07

Re: [Link] Everything about Java 8

Posted 04 September 2013 - 12:54 AM

Quote

I imagine that the java.time is nice, but I wouldn't know. The .NET DateTime was functional out of the box, so I've never had to find a better time lib. I've heard that java's built in dates and times were a pain, but I've never had any experience so I can't comment. Bad enough that they had to include a new API, I guess.


I believe this is actually the third attempt at a date/time library. JDK 1.0 had Date. A year later, JDK 1.1 had Calendar. The thing about the development of Java is that they try and avoid breaking existing code. I'm sure that this is in part responsible for the glacial evolution of the language. New features have to be implemented so they have a minimal impact on existing code, and the language designers have to be very careful about what they introduce because they have basically one shot at it. Once it's there, it's never coming out and never changing substantially.

I'm sure we can all list examples where they did break existing code but one thing they seem fairly consistent is that APIs don't change, and that means if an API is broken, the only way to fix it is to write a new one. I mean it, APIs really don't change. Deprecated methods are pretty much guaranteed to be around forever. I remember finding a bug in Sun's bug database that was confirmed but a fix rejected because existing code might rely on the faulty behaviour. I had a look but can't find the bug now.
Was This Post Helpful? 0
  • +
  • -

#8 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9076
  • View blog
  • Posts: 34,119
  • Joined: 12-June 08

Re: [Link] Everything about Java 8

Posted 11 September 2013 - 07:15 AM

I thought I would add: Java 8 Developer Preview Released .

http://openjdk.java.net/projects/jdk8/
Was This Post Helpful? 2
  • +
  • -

#9 iwansyah_xhaa  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 11-October 13

Re: [Link] Everything about Java 8

Posted 13 October 2013 - 05:08 AM

wow, hope java 8 will be better and better again. Bravo JAVA
Was This Post Helpful? 0
  • +
  • -

#10 andrewsw  Icon User is offline

  • Fire giant boob nipple gun!
  • member icon

Reputation: 3354
  • View blog
  • Posts: 11,353
  • Joined: 12-December 12

Re: [Link] Everything about Java 8

Posted 20 January 2014 - 10:27 AM

The following article is even older (July 2013), but offers a more critical assessment of Java 8.

Love and hate for Java 8
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1