2
votes
2answers
143 views

Is there any reason not to use Optional as a method argument in the case where you know the argument is something that may or may not be needed?

With Java 8, I've seen more and more articles about the use of Option/Optional. I understand what they trying to represent, and I see many examples of them being used as returns. However what I don't ...
3
votes
3answers
2k views

Why were default and static methods added to interfaces in Java 8 when we already had abstract classes?

In Java 8, interfaces can contain implemented methods, static methods, and the so-called "default" methods (which the implementing classes do not need to override). In my (probably naive) view, there ...
16
votes
1answer
793 views

Workaround for Java checked exceptions

I appreciate a lot the new Java 8 features about lambdas and default methods interfaces. Yet, I still get bored with checked exceptions. For instance, if I just want to list all the visible fields of ...
30
votes
3answers
2k views

Why are the Java 8 java.time classes missing a getMillis() method?

Java 8 has a whole new library for dates and times in the package java.time which is very welcome thing to anyone who has had to use JodaTime before or hassle with making it's own date processing ...
4
votes
2answers
1k views

Are Interfaces with Java 8 Virtual Extension Methods the Same Thing as Mixins?

This post describes a new feature in Java 8 called virtual extension methods (formerly called default methods, or defender methods). In the example provided, an interface has one method, which is ...
1
vote
1answer
176 views

Why would someone use @Native annotations?

link : http://download.java.net/jdk8/docs/api/java/lang/annotation/Native.html In Java 8, there will be @Native annotations. Indicates that a field defining a constant value may be referenced ...
11
votes
1answer
1k views

Reasons for removal of function types in Java 8

I have been trying to understand why the JDK 8 Lambda Expert Group (EG) decided not to include a new function type into the Java programming language. Going over the mailing list I found a thread ...
18
votes
2answers
4k views

Type inference in Java 8

Is the introduction of the new lambda notation (see e.g. this article) in Java 8 going to require some kind of type inference? If so, how will the new type system impact the Java language as a whole? ...