Java 8 features Stream API, Lambda and concise code comparison with java 7 - Stack Overflow
Good resources for teaching Java 8 features?
How many of you are using Java 8 in your projects?
I've been using Retrolambda for ages, you don't need Jack if all you're using is lambdas.
More on reddit.comFuture of Java 8 Language Feature Support on Android
So in 5-6 years Android app developers can finally start saying goodbye to java.util.Date? That thing had to die in like Java 5.
public int getYear()
Returns:
the year represented by this date, minus 1900.
Just WHY?!
More on reddit.comVideos
But He said if we are implementing Comparator interface with some class then I can reuse it while using Lambda expression I have to write logic again and again whenever I what to do sorting.
You just have to catch the lambda into a variable as done in the first example and use it everywhere you want. This argument is very common among 7 resisting devs, first tell him that you don't have to construct a class for a single instanciation; second that the comparator code is present at the right place, so that reading how the collection is sorted doesn't need to search for the definition of the sorting class; third that the compiler is best at optimizations when using lambdas...
For Stream API we can also sort elements, So why should we use Stream API of Java8 for sorting
Sorting is exactly one of the functionalities that are not good in streaming POV. It is given just not to break the stream : construct a stream, collect, sort, stream again, etc
I think the key here is not about implementing Comparator or using Lambda, both are ok. What's more important is the transition of our mindset from OOP in Java7 to Functional Programming in Java8. The key of functional programming is to treat functions as the first class citizens, meaning functions and data are of the same importance. It blurs boundaries between them, thus functions can be stored in variables and passed anywhere (pretty much like function pointer in C). Then you can use it anywhere and be free from the rigid Class-Object hierarchy.
My company recently rolled out the first version of our software to use java 8 and I agreed to give a talk about it during our lunch-n-learn next week. Does anyone know any fun examples or tutorials that I can use to make my presentation better?
As for my background I'm a junior developer and the only one on our team to have used some of the new language features like lambdas and functional interfaces. I use them both quite a bit in my own code.