Author: Irfan Khan
15 AprilHow to Deep Copy Arraylist in Java
Learn about how to create deep copy of ArrayList in different ways.
30 DecemberRock Paper Scissors Game in Java
Learn about how to implement Rock Paper Scissors game in java.
11 OctoberJava 9: Stream API Improvements
In Java 9, following methods are added to Stream interface of stream package. These methods are default and static. The takeWhile() Method This method is included in Stream interface and used to collect the elements into a stream. It takes all the elements till the condition specified as predicate. For example, we want to collect […]
09 OctoberFind first and last digit of a number
In this article, we are going to find first and last digit of a number. To find first and last digit of any number, we can have several ways like using modulo operator or pow() and log() methods of Math class etc. Let’s see some examples. Before moving to example, let’s first create an algorithm […]
09 OctoberInitialize 2D array in Java
In this article, we will learn to initialize 2D array in Java. The array is a data structure that is used to collect a similar type of data into contiguous memory space. An array can be a single-dimensional or multidimensional. An array that has 2 dimensions is called 2D or two-dimensional array. There are several […]
03 OctoberHappy Number program in Java
In this article, we are going to learn to find Happy Number using Java. Let’s first understand, what is Happy Number? What is a Happy Number? A number which leaves 1 as a result after a sequence of steps and in each step number is replaced by the sum of squares of its digit. For […]
02 OctoberInitialize ArrayList with values in Java
In this article, we will learn to initialize ArrayList with values in Java. ArrayList is an implementation class of List interface in Java. It is used to store elements. It is based on a dynamic array concept that grows accordingly. We can Initialize ArrayList with values in several ways. Let’s see some of them with […]
30 SeptemberGet Thread Id in Java
In this article, we will learn to get thread id of a running thread in Java. An Id is a unique positive number generated at the time of thread creation. This id remains unchanged during the lifetime of the thread. When a thread gets terminated its id can be used to refer another thread, but […]
30 SeptemberHow to compare characters in Java
Learn about how to compare characters in java using different methods.