Learn Java and Programming through articles, code examples, and tutorials for developers of all levels.
Top 10 Java 8 Tutorials, Classes, and Courses in 2025 - Best of Lot [UPDATED]
How to Convert String to LocalDate, LocalTime, LocalDateTime and ZonedDateTime in Java? Example Tutorial
The JDK 8 added a new Date and Time API (JSR 310) which introduces new date and time classes like LocalDate, LocalTime, LocalDateTime, and ZonedDateTime. Now, if you have a String e.g. "2016-12-14 03:30" then how do parse it to LocalDate, LocalTime, LocalDateTime and ZonedDateTime? Similarly, if you have an instance of those classes how you can format to the String you want e.g. in dd/MM/yyyy format, or USA or UK format? Well, Java 8 provides a utility class called DateTimeFormatter which can be used to parse/format dates in Java 8. It also provides several built-in formatter e.g. ISO date format and other to facilitate formatting of dates to String.
How to convert JSON to Map in Java 8 without using third party libraries like Jackson or Gson
Hello guys, If you are working with JSON data then you may know that JSON is collection of key value pairs and that's why many times, you also need to convert them into a Map in Java. While there are many Java libraries like Jackson and Gson which provides support of parsing JSON to Java objects, there is not much support for JSON parsing or manipulation on standard JDK. While JSON parsing is still a long overdue, starting with JDK 8u60+ the built-in Nashorn engine is capable to convert JSON content into java.util.Map. No external dependencies are required for parsing JSON in to Map as you will learn in this article.
How to remove duplicates from Collections or Stream in Java? Stream distinct() Example
Java 8 Stream.filter() example Example with Null and Empty String
Difference between Abstract class and Interface in Java 8? Answer
How to sort HashMap by values in Java 8 [using Lambdas and Stream] - Example Tutorial
Java 8 StringJoiner Example - How to join multiple Strings with delimiter in Java?
How to Join Multiple Strings in Java 8 - String join() Example
How to Compare and Sort String by their length in Java? Example
Top 15 Java 8 Stream and Functional Programming Interview Questions Answers
How to replace Anonymous Class to Lambda Expression in Java 8? Example Tutorial
Hello guys, you may be thinking why I am talking about Anonymous class now when many Java programmers have already switched to Java 8 and many have already moved on from Anonymous class to Lambda expression in? Well, I am doing it because I am seeing many Java programmers who find it difficult to write and read code using lambda expression in new Java 8 way. It's also my own experience that if you know the problem first, you can better understand the solution (lambda expression). Some of you might remember, the opening scene of MI 2 (Mission Impossible 2), when Nekhorovich says to Dimitri that "Every search for a hero must begin with something that every hero requires, a villain. Therefore, in our search for a hero, Belairiform, we created the monster, Chimera".
Top 5 Functional Interface Every Java Developer Should Learn
Hello guys, functional interface in Java are an important concept but not many developer pay enough attention to them. They learn lambda and method reference but the functional interface from java.util.function package. While its not really possible to learn all the functional interfaces on that package but you can learn a few more commonly used ones like Predicate, Supplier, Consumer etc and that's what you will learn in this article. But, before we get to the top 5 functional interfaces that every Java developer should learn, let me tell you a bit about what Java really is.
Top 5 Books to Learn Java 8 and Functional Programming - Best of Lot
Java 8 Optional isPresent(), OrElse() and get() Examples
Default Methods and Multiple Inheritance in Java 8
10 Examples of Collectors + Stream in Java 8 - groupingBy(), toList(), toMap()
How to use Spliterator in Java 8 - Example Tutorial
Hello friends, we are here today again on the journey of Java. And today, we are gonna learn about SplitIterator class from Stream package that may not be used in your day-to-day life but can be very useful to know as Java internally does use this with both normal streams and parallel streams. As always, let’s take an example of a situation. I will present you with a situation and you guys can think about it. So, let’s say we have an array with 50k records in it. Now, these all records need to be modified, let’s say they are strings and we need to append the string with a name. Now, traversing the array sequentially would be time-consuming. Any innovative ideas my friends?