java

java

Java 8 Stream min and max method examples

In this tutorial, we will learn how to use min and max methods of Java 8 Stream to find the minimum and maximum element in a list. For both 'max' and 'min', we will pass one 'Comparator' using which each item will be compared to each other to find the minimum or maximum values.

Read
java

Java program to get the maximum number holder Student

In this tutorial, we will create and store some student's details and find out the Student with highest marks. We have two classes in this example. First one is the 'Student.java' class and second one is the 'Main.java' class. 'Student.java' will hold the informations about a student. And, 'Main.java' is used to do other tasks like create a student, find the top student etc.

Read
java

Java program to find the circumference and area of a circle

In this tutorial, we will learn how to find the area and circumference of a circle using Java. We only need the radius of the circle to find both of these values. Area is 'PI*radius*radius'and circumference is '2*PI*radius'. Let's take a look how to calculate these values :.

Read
java

Java program to check if a number is perfect or not

In this tutorial, we will learn how to find the maximum and minimum values in a list within range. Steps we are using in this Example program is as below :.

Read
java

Java program to find maximum and minimum values of a list in a range

In this tutorial, we will learn how to find the maximum and minimum values in a list within range. Steps we are using in this Example program is as below :.

Read
java

Java Program to check if a number is Neon or not

In this Java tutorial, we will learn how to check if a number is 'Neon' number or not. A 'Neon' number is a number whose sum of all digits of square of the number is equal to the number. For example, '9' is a Neon number. Because, square of 9 is 9*9= 81. Sum of all digits of 81 is 8+1=9. So it is a Neon number. Similarly 1 is also a Neon number. But 8 is not.

Read
java

Java Program to find Transpose of a matrix

In this tutorial, we will learn how to print the transpose of a matrix in Java. But first let me show you want is transpose of a Matrix :.

Read
java

Java program to remove element from an ArrayList of a specific index

In this program, we will learn how to remove an element of a specific index from an ArrayList. First, we will take 'n' number of inputs from the user . Next we will get the index of the number to be removed. To remove an element from a ArrayList, we can use 'remove(index)' method. 'index' is the index number. If the index is available, we will remove that number , otherwise we will ask the user for a valid input.

Read
java

Java StringTokenizer example to Split a String

Using StringTokenizer class, we can split a string into tokens.We can specify the delimiter that is used to split the string. For example, 'Hello World' string can be split into 'Hello' and 'World' if we mention the delimiter as space (''). In this tutorial, we will learn how to use 'StringTokenizer' to split a string. I will show you two different examples- to split a string by space and to split by a character (e.g. $).

Read
java

Java Program to find Simple Interest

In this program, we will learn how to find the simple interest using Java. To calculate simple interest, we need principal amount, rate of interest and time in year. After that , calculating the simple interest is really easy :.

Read