java

java

Java program to find the absolute value of a number

Java program to find the absolute value of a number. We can use Math.abs method to find the absolute value of a number.

Read
java

Find the largest number from an array in Java

Java program to find the largest number that can be formed from an array of numbers. The program will take the numbers as input from the user.

Read
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

4 ways in Java 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