<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ranjan Pandey</title>
    <description>The latest articles on DEV Community by Ranjan Pandey (@ranjan715).</description>
    <link>https://dev.to/ranjan715</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F693216%2F1164359f-4cb6-45c1-ac52-a89f47bcd344.png</url>
      <title>DEV Community: Ranjan Pandey</title>
      <link>https://dev.to/ranjan715</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ranjan715"/>
    <language>en</language>
    <item>
      <title>Java 8 features implementation</title>
      <dc:creator>Ranjan Pandey</dc:creator>
      <pubDate>Wed, 25 Aug 2021 13:22:02 +0000</pubDate>
      <link>https://dev.to/ranjan715/java-8-features-implementation-5hi5</link>
      <guid>https://dev.to/ranjan715/java-8-features-implementation-5hi5</guid>
      <description>&lt;h2&gt;
  
  
  Features in Java-8
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Interface Enhancement&lt;/li&gt;
&lt;li&gt;Functional Interface&lt;/li&gt;
&lt;li&gt;Lambda Expression&lt;/li&gt;
&lt;li&gt;Stream API&lt;/li&gt;
&lt;li&gt;Date &amp;amp; Time API&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;a. Introduction of default methods - Supports backward compatibility&lt;br&gt;
    1. default method is available inside the implementing class&lt;br&gt;
    2. there can be more than 1 default method in interface&lt;br&gt;
    3. default method helps in bringing backward compatibility&lt;/p&gt;

&lt;p&gt;b. Introduction of static method&lt;br&gt;
    1. static method is not available inside the implementing class&lt;br&gt;
    2. there can be more than 1 static method in interface&lt;br&gt;
    3. static method helps in bringing backward compatibility&lt;br&gt;
    4. we cannot override static method&lt;br&gt;
    5. Java 8 onwards main method can be part of interface&lt;/p&gt;

&lt;p&gt;c. Functional Interface&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;An interface having one and only one abstract method is a functional&lt;/li&gt;
&lt;li&gt;Runnable interface had only 1 abstract method called run() - ex. functional interface&lt;/li&gt;
&lt;li&gt;Comparable interface had only 1 abstract method called compareTo() - ex. functional interface&lt;/li&gt;
&lt;li&gt;Functional interface can have any number of default and static method but only 1 abstract method
thats why it is also called as SAM interface&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;d. Lambda expression&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;OOP -&amp;gt; Programming paradigm should adhere to Classes, Objects, Encapsulation, Inheritance, Polymorphirm, Abstraction&lt;/li&gt;
&lt;li&gt;Functional programming - Here implementation of same functionality can be done in clear and concise manner.

&lt;ul&gt;
&lt;li&gt;Code will be less, implementation will compact&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;e. Predicates&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Are predefined functional interfaces&lt;/li&gt;
&lt;li&gt;Return boolean value&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;f. Double colon operator =&amp;gt; can be used as an alternative to Lambda expression&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;method reference - instance and static method&lt;/li&gt;
&lt;li&gt;constructor reference&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;g. Streams - java.util.stream&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Helps to operate on collection object&lt;/li&gt;
&lt;li&gt;distinct function removed duplicate and returns unique list&lt;/li&gt;
&lt;li&gt;skip functions skips the specified number of elements from starting&lt;/li&gt;
&lt;li&gt;peek function helps in debugging to see what is happening after a particular operation on the stream&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;h. Java-8: Date Time API&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In java 7 we had Date, Calender, Timestamp, they were not efficient, it was present in java.util package&lt;/li&gt;
&lt;li&gt;In Java 8 a new Date Time API was introduced which is also called as Joda Time Api in a new package called java.time&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to implement all Java8 concepts in practical handson based approach than checkout my popular udemy course:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.udemy.com/course/practical-java-8-mastery-course/?couponCode=1DCCF8309E7BB06E4C42"&gt;https://www.udemy.com/course/practical-java-8-mastery-course/?couponCode=1DCCF8309E7BB06E4C42&lt;/a&gt;&lt;/p&gt;

</description>
      <category>java</category>
    </item>
  </channel>
</rss>
