Java Programs

Java Programs Interview Questions

String Related Java Programs

Reverse a string in Java (6 Different Ways)
Splitting a String in Java using a delimiter
Count number of words in a string java
Count total number of times each character appears in the string in java
Check if two strings are anagrams or not in java
How to convert string to int without using library functions in java
Check Whether a Given String/Number is a Palindrome in java
How to find first non-repeated character in a given String in Java
How to find first non-repeatable character from a String using Java 8
Java Program to find the frequency of each character in String ?

Number Related Java Programs

How to convert number to words in java
How to swap two numbers with or without temporary variable in java
Java Program to Swap two numbers using Bitwise XOR Operator?
How to reverse a number in Java
How to check Armstrong number java program
Java program to find factorial of a number
Java Program to Calculate the Power of a Number
Check whether a number is prime or not
Java Program to displaying prime numbers
Fibonacci series using iterative and recursive approach java program
Find largest and second largest number in the given Array
Java program to Remove Duplicate Elements From an Array
Find common elements between two Arrays
Find largest and smallest number in the given Array
Java Program to find duplicate elements in an Array
Count number of words in a string in java
How would you check if a number is even or odd using bit wise operator in Java?
How can you check if the given number is power of 2?
How to check if String is number in java ?

Arrays Based Programs:

Write a program to move all negative elements to end in an int array ?
Write a program to move all zero at the end of the array with/without using existing data structures ?

 Collection based Java Programs

How will you find Word Frequency in a collection of words?
How to Sort Map based on Values in java ?
There is a stream of words which contains Anagrams. How would you print anagrams in a single bucket from that stream?

Java Multi-Threading
Java program to Print numbers in sequence using 3 Threads
Java Program to Print Even and Odd Numbers Using 2 Threads
Print numbers in sequence using 3 Threads & Executor Service
Print numbers in sequence using 2 Threads – Approach-2
Java program to Print numbers in sequence using 2 Threads & Executor Framework
Print Odd and Even Numbers Using Threads And Semaphore
CountDownLatch Example in Java
CyclicBarrier Example in Java
Semaphore Example in Java

Matrix based Java Programs

Java program to add two matrices
Java program to find maximum element in each row of the matrix
Java program to find maximum and minimum numbers in the given matrix

Other Java Programs

How to implement LRU Cache in Java?
What will happen if in a try block we throw an exception but in the finally block we return a int value?
Adding two numbers without using arithmetic operators?

If you have any feedback or suggestion please feel free to drop in below comment box.