java

java

How to create a directory programmatically in Java using File class

Java program to create a directory programmatically using File class. In this example, we will learn how to use File class to create a directory programmatically using mkdir() method.

Read
java

Java program to read user input using Console

Java program to read user input value using java.io.Console. This example will show how to read different types of values like character, string, integer, float and boolean using Console.

Read
java

Java program to find all files with given extension in a directory and its subdirectories

Java program to find all files with given extension in a directory and its subdirectories. This example will show you how to find all files recursively in folders and subfolders.

Read
java

Java program to find the area of a Trapezoid

Java program to find the area of a trapezoid. This program will take the base and height of the trapezoid as input from the user and print the area of the trapezoid.

Read
java

Java program to find the sum of all odd numbers in an array

Java program to find the sum of odd numbers in an array. This program will take the numbers as input from the user, add them in an array and print the sum of all odd numbers in that array.

Read
java

Java program to get the sum of even numbers in an array

Java program to find the sum of all even numbers in an array. This java program will take the numbers as input from the user and print out the total sum of all even numbers.

Read
java

Java Program to find the first digit of a positive or negative number

Java program to find the first digit of a positive or negative number. We will learn three different Java programs to find the first digit of a number with examples.

Read
java

Java program to find the factors of a number

Java program to find the factors of a number. In this post, we will learn how to find the factors of a number in Java. The program will take the number as input and print out its factors.

Read
java

Java program to check if a user input number is strong or not

Java program to check if a user input number is strong or not. A number is called a strong number if the sum of all factorials of its digits is equal to the number itself.

Read
java

How to get the last element of a stream in Java

Learn how to get the last element of a Java stream. We will learn two different ways to find the last element of a stream with examples.

Read