# Java programs

## Java program to check whether number is prime or not

Let’s learn java program to check whether a number is prime or not. Java program to check whether number is prime or not Prime numbers are those numbers which cannot be divided by other numbers than 1 or itself. Example : 2, 3, 5, 7, 11, 13, 17…. NOTE: 0 and 1 are not prime numbers.…

Read More Java program to check whether number is prime or not

## Java program to display pascal triangle

Let’s learn java program to display pascal triangle. Java program to display pascal triangle Pascal’s triangle is a triangle of binomial coefficients arranged in the form of a triangle. Pascal’s triangle is named after french mathematician Blaise Pascal. Pascal’s triangle looks like this, In the above pascal’s triangle there are five rows. First row starts…

Read More Java program to display pascal triangle

## Java program to check whether string is palindrome

Let’s learn java program to check whether string is palindrome. Java program to check whether string is palindrome Palindrome string check program one of the interview question. Palindrome string is a string where string remains same when reversed or a word spelled same way forwards and backwards. Example: level, dad, mom, madam, abcba, etc., Here…

Read More Java program to check whether string is palindrome

## Java program to check if a number is palindrome or not

Let’s learn java program to check if a number is palindrome or not. Java program to check if a number is palindrome or not Palindrome number program using scanner or check if a number is palindrome or not is one of the interview question. Palindrome number is a number which when reversed remains the same.…

Read More Java program to check if a number is palindrome or not

## Java convert octal to decimal

Let’s learn how do you convert octal to decimal in java? Java convert octal to decimal To convert octal to decimal use parseInt() method of Integer class. Syntax for Integer.parseInt() method is as follows public static int parseInt(String s, int radix) throws NumberFormatException Integer.parseInt() method returns the integer represented by the string argument in the…

Read More Java convert octal to decimal

## Java program to find transpose of a matrix

Let’s learn how do you find the transpose of a matrix in java program? Java program to find transpose of a matrix Java program to transpose matrix is one of the common interview question in java. Transpose means converting rows of matrix into columns and columns of matrix into row. For example: 3×3 matrix —————–…

Read More Java program to find transpose of a matrix

## Java program to find if given year is leap year

Let’s learn java program to find if given year is leap year. Java program to find if given year is leap year Java program to check whether year is leap year or not is one of the common interview question. Leap year is a year where it has 366 days. In leap year program in…

Read More Java program to find if given year is leap year

## Java convert hex to decimal

Let’s learn java convert hex to decimal. Java convert hex to decimal Java program that converts a hexadecimal number to a decimal number is one of the frequently asked java program interview question. In hexadecimal to decimal java conversion we are using Integer.parseInt() method. Integer.parseInt() method parses string argument as a signed integer in the…

Read More Java convert hex to decimal

## Java program to print Floyd’s triangle

Let’s learn java program to print Floyd’s triangle. Java program to print Floyd’s triangle Floyd triangle in java is one of the common java interview question. First let’s learn what is floyd’s triangle in java. Floyd triangle is a right angled triangle of array of natural numbers starting with 1 in the top left corner.…

Read More Java program to print Floyd’s triangle

## Factorial program in java

Let’s learn how do you program a factorial in java? Factorial program in java Factorial of a number in java or factorial in java is one of the common java interview question. Factorial is the product of all integers less than or equal to given number. Denoted as n! For example, 6! = 6 *…

Read More Factorial program in java