First non-repeated character in a String in Java
We have to find the first non-repeating character from given string. For example, if the given string is "hello" then the output should be "h" because except "l" all are…
We have to find the first non-repeating character from given string. For example, if the given string is "hello" then the output should be "h" because except "l" all are…
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…
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…
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…
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…
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 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…
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…
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…
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…
Duplicate characters in a string are characters that appear multiple times. These characters can be found using a nested loop or some other ways Java program to find all duplicate…
Program to remove duplicate element in an Array using Temp Array class RemoveDuplicateInArray { public static int removeDuplicateElementsFromArray(int array[], int size) { if (size == 0 || size == 1)…
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 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…
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…
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…
What is Fibonacci series Fibonacci series is a sequence of natural numbers and the next number is the sum of the two previous numbers, such as fn = fn-1 +…
Reversing an array in java can be done using a simple for loop or in-built api Collections.reverse method.
A string is a palindrome if the position of each character is the same even if the string is reversed. For example, "NAMAN"
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.