Java - Medium Articles
Angle Bracket in Java is used to define Generics. It means that the angle bracket takes a generic type, say T, in the definition and… Read More
foreach() loop Lambda operator is not used: foreach loop in Java doesn’t use any lambda operations and thus operations can be applied on any value… Read More
The classModifiers() method of java.lang.reflect.Modifier class is used to get an integer value together with the modifiers of source language that can be applied to… Read More
In Java, Tokens are the smallest elements of a program that is meaningful to the compiler. They are also known as the fundamental building blocks… Read More
The String hashCode() method returns the hashcode value of this String as an Integer. Syntax: public int hashCode() For Example: import java.io.*;    class GFG… Read More
Given an array arr in Java, the task is to print the contents of this array without using any loop. First let’s see the loop method. … Read More
Given a String S of length N, two integers B and C, the task is to traverse characters starting from the beginning, swapping a character… Read More
Prerequisite: Generic Class  We can also use them to code for Graph in Java. The Graph class is implemented using HashMap in Java. As we… Read More
Pre-requisite: Hamming code Hamming code is a set of error-correction codes that can be used to detect and correct the errors that can occur when… Read More
Given two integers A and B. The task is to find the nearest greater value to B by interchanging the digits of A. If no… Read More
The ifPresentOrElse(Consumer, Runnable) method of java.util.Optional class helps us to perform the specified Consumer action the value of this Optional object. If a value is… Read More
The ofNullable() method of java.util.Optional class in Java is used to get an instance of this Optional class with the specified value of the specified… Read More
The Path interface was added to Java NIO in Java 7. The Path interface is located in the java.nio.file package, so the fully qualified name… Read More
The IT industry, especially in India, heavily uses Java in most of their projects. Being a Java developer, one should have the knowledge about the… Read More
We can call the private method of a class from another class in Java (which is defined using the private access modifier in Java). We… Read More
The ExecutorService interface extends Executor by adding methods that help manage and control the execution of threads. It is defined in java.util.concurrent package. It defines… Read More
Early Binding: The binding which can be resolved at compile time by the compiler is known as static or early binding. Binding of all the… Read More
In this article we discuss the Cloneable interface that indicates that a class has provided a safe clone() method. To understand what cloning means recall… Read More
Java is pass by value and it is not possible to pass integer by reference in Java directly. Objects created in Java are references which… Read More
OptionalInt help us to create an object which may or may not contain a int value. The getAsInt() method returns value If a value is… Read More