java

java

Java program to convert a Hexadecimal value to Decimal

Java program to convert a hexadecimal value to decimal in two different ways. We will learn how to do the conversion by iterating through the digits of the number and by using Integer.parseInt method.

Read
java

Java program to print the harmonic series

Java program to print the harmonic series. We will learn three different ways to print this series. The program will print the value as number or as string.

Read
java

Java program to check if two strings are an anagram or not

Java program to check if two strings are anagram or not. The program will take two strings as the inputs and return one boolean value if the strings are anagram or not.

Read
java

Java program to find the first repeating character in a string

Java program to find the first repeating character of a string. We will learn two ways to do it, by using a for loop and by using a hashset.

Read
java

4 different Java program to find a random value in an array

Java program to find a random value in an array in 4 different ways. We will use java.Math, java.util.Random, java.util.concurrent.ThreadLocalRandom and SecureRandom to find a random value in an array.

Read
java

Java program to check if a year is a leap year or not

How to check if a year is leap year or not in Java. We will also learn how to print all leap years in a given range of years.

Read
java

Different ways to find the factorial of a number in Java

Different Java programs to find the factorial of a number. Learn how to do it by using a for loop, while loop, do-while loop and recursively.

Read
java

Java program to check if a string is a prime number or not

Java program to check if a string is a prime number or not. This program will take a string value as an input from the user and print if it is prime. We will learn 3 different ways to do that.

Read
java

Java program to find all prime numbers from 1 to N

Java program to find all prime numbers from 1 to N. This post will show you how to find if a number is prime or not and how to find all prime numbers in a range in Java.

Read
java

Java program to check if a given number is a prime number or not

Java program to check if a number is prime number or not. This post will show you two different ways to check if a number is a prime number or not in Java.

Read