Multiply two matrices in Java

We can add two matrices in java using binary * operator and multi-dimensional arrays creation. In java “array of arrays “ approach is used for create multi-dimensional array. In case…

Adding two matrices in Java

We can add two matrices in java using multi-dimensional arrays. In java "array of arrays " approach is used for create multi-dimensional array Examples:We have two matrices A and B…

Print Pattern in Java

Java pattern programs enhance the concepts of coding, logic, and loops. The main question in the Java interview is to test the logic and thinking of the programmer. We can…

Reverse a Number in Java

In this section, we will reverse a number using three ways . Using while loopUsing for loopUsing recursion Example - Program to Reverse a number using while loop public class…

Avoid Deadlock in Java

What is Deadlock ? Deadlock is a programming situation in a multi-threaded environment where each process or thread is waiting to release resources that are controlled by another process. Deadlock…

Reverse words in Java

Reverse the given string from start to end .Example:Original String : Proedu provides tutorials and interview questionsReverse String : questions interview and tutorials provides Proedu Example - Program to Reverse…

Leap year in Java

A leap year is a 366-day year, which is one day longer than a normal year. This additional day comes is in February, where February is 29 days compared to…

Strings are Anagram in Java

What is Anagram ? Strings are called anagram, if they contains the same characters but on different order e.g. army and mary, stop and pots, etc. Example - Program to…

Find square root of a Number in java

There are several ways to find the square root of a particular number in Java. Let's see some of them. Program to Find the square root of a Number using…

Reverse a string in Java

There are many ways to reverse String in Java. We can reverse a String using factory inbuilt method, loop iteration etc. Program to Reverse a String using loop class ReverseString…

Factorial Program in Java

 Factorial of n is the product of all positive descending integers. Factorial of n is denoted by n!. For example: 4! = 4*3*2*1 = 24   5! = 5*4*3*2*1 = 120 Factorial Program using while loop public class FactorialProgram { public static…

Armstrong number in java

A positive number is called an Armstrong number if it is equal to the cubic sum of that number. For example, 0, 1, 153, 370, 371, 407. For example: Lets…

Integer Palindrome in Java

When integer number is same when it is written in forward or backward then number is called integer palindrome ORA number and reverse of same number, both are same then…

Reverse an array in Java

Reversing an array in java can be done using a simple for loop or in-built api Collections.reverse method.

Palindrome program in Java

A string is a palindrome if the position of each character is the same even if the string is reversed. For example, "NAMAN"

Prime Number Program in Java

A prime number is a number greater than 1 and divided by 1 or by itself. That is, Prime number is only divisible by 1 or itself.