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.
ReadIn 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.
ReadIn 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 :.
ReadIn 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 :.
ReadIn 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 :.
ReadIn 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.
ReadIn 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 :.
ReadIn 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.
ReadUsing 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. $).
ReadIn 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