-2

I would like to understand how jdk1.8 code is, as compared to code of jdk1.6

Can anyone provide an example, or a link??

Thanks

I want to see a comparison between code written in java6 and cod written in java8,

to understand the features of java8 and how it simplifies the code

I just need an example of a program written in java6 , against a program written in java8

N V
  • 122
  • 1
  • 2
  • 12
  • Your question is clear enough to understand. Please provide some more details. – Abdul Waheed Dec 30 '16 at 10:59
  • @AbdulWaheed I have updated my question – N V Dec 30 '16 at 11:01
  • Can someone provide a link??? I searched, and got this link : https://zeroturnaround.com/rebellabs/what-migrating-to-java-8-will-do-to-your-codebase-a-practical-example/ but it doesn't show an example for comparison between jdk 1.6 and 1.8 – N V Dec 30 '16 at 11:15
  • The link you posted shows the difference in code between old (pink) and new (green). It is a direct comparison of code using jdk 1.6 versus 1.8. I don't understand what it is missing in terms of what you are looking for. – Klitos Kyriacou Dec 30 '16 at 14:39

2 Answers2

1

The below link will help you understand how Java8 feature 'Lambda Expression' simplifies the code.

Java8 Lambda Expression - The What and Why

Ratha
  • 46
  • 5
0

There are many features available in Java 8 and code enhancement that was not available in java 6.

A useful compiler feature that is added in Java 7 is the 'diamond operator'. E.g, instead of typing

ArrayList<Integer> arrInt = new ArrayList<Integer>();

You could just type

ArrayList<Integer> arrInt = new ArrayList<>();

In Java 8 many features are available. For further details you may visit mentioned links

https://www.javacodegeeks.com/2014/03/8-new-features-for-java-8.html

http://www.oracle.com/technetwork/java/javase/8-whats-new-2157071.html

Abdul Waheed
  • 4,540
  • 6
  • 35
  • 58
  • I want a specific example of a program written in java6, against the same program written in java8. Can you provide it, please? – N V Dec 30 '16 at 11:20