Predicate in java 8

If you want to learn java 8 or complete features of Java 8, you need to understand the basic interfaces. In this topic, we will discuss one of them and that is the java predicate and predicate in java 8. Most programmer doesn’t know how to with java predicate or java 8 predicate. Here we … Read more

functional interface in java 8

In this article, we will discuss the functional interface in java 8. How to use the functional interface in Java 8. Here is the table content of the article will we will cover this topic.1. What is the functional interface in java 8?2. What is the use of @FunctionalInterface annotation?3. Important points about the functional … Read more

Java 8 tutorial

Welcome to Java 8 tutorial. Here we will guide you step by step through all the new language features of Java 8. To use all features of Java 8 you need to download JDK 8. Java 8 is the most awaited and is a major feature release of the Java programming language. Here we list … Read more

Integer wrapper object interning

As you already know the == operator always checks the reference or objects. So, whenever you create an object of Integer class(Wrapper class), the valueOf() method called every time. The value of the method checks the integer value if the value lies between -128 to 127 it returns the same reference. If value exceed from … Read more

Advantages of generics in java

Generic provides various types of advantages. By use of generic Java makes ease for the programmer. So let’s discuss the Advantages of generics in java. 1. Type-safety: Suppose you want to store the name of books in ArrayList and by mistake, you added an Integer value instead if String. The Compiler allows it, but the … Read more

Generic types in Java

Now we have some knowledge of Generics in Java. So, we should start exploring other important concepts revolving around generics. We will discuss the Java generic type. 1. Generic class 2. How to create a generic class?3. Generic method4. Generic Interface 1. Generic class Without generic, A class that can refer to any type of … Read more

Generics in Java

Generic is the most important in Java. In this article, we will read all detail of java generics.Here is the table content of the article will we will cover this topic.1. What is Java Generics?2. Generic class3. Generic method4. Generic Interface5. Advantages of Generics What is Java Generics? In Java, we can create a Generic … Read more

Java Thread Sleep

In a multithreading environment, multiple threads can run concurrently. But there may be a situation when we want to pause the execution of a thread for a specific amount of time. To pause the execution of a thread for a specific time we can use the sleep() method in java. In this post, we will … Read more

How comparable useful over Comparator?

In this post, we see the diff between comparable and comparator and how comparable useful over Comparator? What are the different scenarios in which we should use the comparable and comparator in java. Diff between comparable and comparator Usage of Java function Arays.sort() and Collection.sort(): If you are using Comparable for Sorting then you can … Read more

How Comparator useful over comparable

In this post we see comparator vs comparable a d when we should you them. How Comparator useful over comparable, Let’s discuss them with different examples. comparator vs comparable Changes in Main Class: As you know Comparable must be implement it in your class for which you want to perform Sorting. So, you need to … Read more