## Display Armstrong Numbers in Java

This post shows how you can generate and display Armstrong numbers in Java with in the given range. A number is an Armstrong number if it is equal to the sum of its digit raised to the power of count of digits in the number. As example – 371 =…

## Java Program to Check if Armstrong Number

In this post we’ll see a Java program to check if the passed number is an Armstrong number or not. A number is an Armstrong number if it is equal to the number you get by raising every digit of the number to the power of count of digits in…

## Display Prime Numbers in Java

This post shows how you can generate and display prime numbers in Java in the given range. A number is a prime number if can be divided either by 1 or by the number itself. So every number with in the given range has to be divided starting from 2…

## Remove Element From an Array in Java

In this post we’ll see how to remove or delete element from an array in Java. You have several options to do that task of removing an element from an array. Write your own logic. Use ArrayList to remove an element. You will need to convert array to ArrayList and…

## Matrix Subtraction Java Program

This post shows a Java program to subtract two matrices. When you subtract two matrices you subtract the element at the same index in both matrices so you’ll subtract the element at index (0, 0) in the first matrix with the element at index (0, 0) in the second matrix…

## Java Program to Find Longest Palindrome in The Given String

In this post we’ll see a Java program to find the longest palindrome in the given string. In the given string there may be more than one palindromes but you need to find which one is the longest and display that one. For finding the longest palindrome in the string…

This post shows a Java program to add two matrices. When you add two matrices you add the element at the same index in both matrices so you’ll add the element at index (0, 0) in the first matrix with the element at index (0, 0) in the second matrix…

## Java Program to Check Whether Number Prime or Not

This post shows a Java program to check whether the passed number is a prime number or not. A number is a prime number if can be divided either by 1 or by the number itself. So the logic for your program should be to run a for loop and…

## Java Program to Swap Two Numbers Without Using Third Variable

Given two int variables write a Java program to swap the values of the variables without using third variable is one question asked in many interviews. In this post we’ll see one way of doing that. Logic used here is to add both the variables and hold that value in…

## Java Programs

String Count The Frequency of Each Character in a String Java Program to Count Number of Words in a String Java Program to Find Duplicate Characters in a String With Repetition Count Check Given String Palindrome or Not Java Program to Find Longest Palindrome in The Given String Java Program…