DayOfWeek is an enum in Java that represents all seven days of a week. It is defined as :.
ReadIn this tutorial, we will learn how to find if a matrix is upper triangular or not. A matrix is called upper triangular if all the elements of the matrix below the main diagonal is 0. Else, it is not an upper triangular matrix.
ReadIn this tutorial, we will learn how to move all 0 of an integer array to the end of that array in Java. For example, for the array {1,0,2,0,3,0}, it will become {1,2,3,0,0,0}. The algorithm we are going to use is as below :. array
ReadTwo ways in Java to move all the zeros of an integer array to the start of the array. We will learn how to move the zeros by maintaining the order of the numbers and without maintaining the order of the numbers of the array.
ReadUsing static import in Java, we can access any public static member of a class directly without using its class name. For example, to find the square root of a number , we have sqrt() method defined in Math class. Since it is a public static class (public static double sqrt(double a)), we can call it directly using the class name like Math.sqrt(4). But , we can also use static import of the class Math and call sqrt method directly like sqrt(4).
Read3 different ways in Java to check if the digits of a number are in increasing order or ascending order. We will learn how to use a while loop, a different method and by converting the number to a String.
ReadA number is called a Pronic number or Heteromecic number if it is equal to the product of two consecutive numbers. For example, 9 * 10 = 90, so 90 is a Pronic number.Our program will take the input from the user and check if it is Pronic.Let's take a look at the program first :.
ReadIn this tutorial, we will learn how to create a temporary file in Java. We can create a temp file either in the default temporary file location folder or in a specific folder. To handle this, we have two different static methods in the File class. Let's take a look into them first :.
ReadIn this tutorial, we will learn how to extract numbers from a String using Java programming language. The user will enter the string and our program will extract all numbers from the string and print out the result. Let's take a look at the program first :.
ReadIn this tutorial, we will learn how to print the boundary elements of a matrix using Java. For example, for the below matrix :.
Read