All Testing Interview Related Java Program
When we attend an interview at that time, the interviewer asked so many Java Programs to check your problem-solving skills. So In this post, we are trying to share as much as Java Programs of Various Concept starting from the Basic Java Programs to the advanced concept like Collection.
If you have faced any Java program, then let us know, we try to update that too in this list, so like you, others also get benefitted.
Basic Java Programs
- 5 Star Pyramid Patterns Program In Java
- Number Pattern Programs In Java
- Count Number Of Lines In A String
- Execute EXE Files In Java
- Factorial Number In Java
- Fibonacci Series Using Java
- Fibonacci Numbers Using Java
- Prime Number In Java
- LeapYear In Java
- Armstrong Numbers In Java
- Palindrome Number In Java
- Check Entered Value Integer In Java
- Odd/Even Number In Java
- Multiplication Table In Java
- Convert Binary Decimal Java Program
- Convert Decimal To Binary in Java
- If Else In Java
- ReferEnce Variable In Java
- Final Variable In Java
- Parent Reference Implementation
- Scanner class in Java
- Sum Of Digits In Java
- Add two Matrices in Java
- Verify Two Arrays Are Equal Or Not
- Swap Numbers Without a Third Variable
- Swap Two Numbers Using the Third Variable
Constructor Java Programs
- How Default Constructor & Static Block Called In Java
- How The Default constructor call in Java
- Call Parameterized Constructor In Java
- Different Ways to Create Object In Java
- A different way to initialize value in Java
- Find Two Objects Hashcode In Java
- How Does Equals Method Work in Java
- How to Static method works in Java
OOPS Java Programs
- Abstract class in Java
- How Static Block Works In Java
- How Static Variable Works In Java
- How To Check Class inherits the constructor of other class or Not?
- Compare two Objects Using Hashcode In Java
- Declare and Implement Interface in java
- Widening In Java Example Program
- Find Distinct Element Using POJO Class
- How to use instanceof Method in Java
- Subclass In Java With Example
- Main Method Overloading In Java
Array Java Programs
- Simple Array Java Program
- Basic Java Array Programs For Freshers
- Print Default Array Value Program In Java
- Get Second Highest Element In an Array
- Find The Duplicate Elements In An Array
- Find Common Element Between Two Arrays In Java
- Duplicate Array Elements Using Java Example Program
- Find Pair Elements In an Array In Java
- Find Second Highest Number In An Array
- Find Two Max Numbers From an Array In Java
- Verify Two Arrays are Equal Or Not Without Using Predefined Function
- Compare Two Array In Java
- Copy Elements From One Array to Another Array
- Find Largest & Smallest Number in an Array
- Array toString() Program In Java
- Copy Specific Array Values into String In Java
String Related Java Programs
- String vs StringBuilder vs StringBuffer Works In A Java Program
- Compare String Values using Equals() & equalsIgnoreCase()
- Compare two String matches() In Java
- Compare two String Using equals() In Java
- Compare two String Values Using contentEquals() In Java
- Concat two String In Java
- Reverse Vowels Of a String
- Reverse String in Java
- Divide a String Using split() Method In Java
- Initialize String Variable In Java
- Replace Character In A String Using replace() In Java
- Sum Of Numeric Value in a String In Java
- Find the Last Character Index from String Using lastIndexOf()
- Find the Starting Character Of a String Using startsWith()
- Remove Unnecessary Spaces Using Trim() In Java
- Reverse String Java With Out Using Collection
- Reverse Words Of A String with Out Using Predefined methods
- Sort String By Using Sort() Method In Java
- Split String Message Into Tokens In Java
- Split String Using StringTokenizer In Java
- Find out Integer To String
- Data hiding in Java
- Swap Two String With Out Using Any Method In Java
- Reverse Word of a String in Java charAt()
- Extract Number From A String In Java
- Find The Numbers In a String and Sum Of The Numbers
- Remove Spaces From Sentence In Java
Advanced OOPS Java Programs
- Find Word Count In a String Using Java
- Find Specific Character Index In Java
- Write Text File Using Java
- Write a Program To Find Inheritance In Java
- Use Super Keyword In Java
- Use This Keyword In Java
Exception Handling Java Programs
- Handle Exception By Manually using throw Keyword In Java
- Handle Exception Using Try Catch Block In Java
- Handle Exception Using Try Finally In Java
- Use Try, Catch & Finally Exception in Java
- How you Call a Custom Exception
- What and How to Handel ArrayIndex Exception
Collection Java Program
List Java Programs
- Different ArrayList Operation In Java
- Add Element In List In Java
- Swap ArrayList Elements In Java
- Verify Between List ArrayList Element In Java
- Remove Elements From List In Java
- Retrieve Elements from List Iterator
- Reverse Array List Elements In Java
- Reverse Elements Of ArrayList In Java
- Adding New Element ArrayList In Java
- Access Elements Using ArrayList Iterator In Java
- Clear ArrayList Values In Java
- Retrieve ArrayList Elements In Java
HashMap Java Programs
- Add Values In LinkedHashMap Java
- Add & Retrieve Elements In Hashmap Java
- LinkedHashMap Methods Used In Java
- Verify Hashmap Elements By Value In Java
- Add New Values In Java Hashmap
- Find Basic Hashmap Operation In Java
- Find First Repeated & Non-Repeated Character In Java Using HashMap
LinkedList Java Programs
- Different Basic Methods LinkedList In Java With Example?
- Remove Elements LinkedList In Java
- Add Values Last LinkedList in Java
- Copy Values Of One List To Another LinkedList Java
- Get All Values LinkedList HasNext() In Java
- Get Last Element LinkedList In Java
- Reverse LinkedList Value Using Collections In Java
- Swap LinkedList Values in Java Using Swap()
- Verify Element Presence LinkedList In Java
- Clear LinkedList Values In Java
- Get the First Element of LinkedList In Java
LinkedHashSet Java Programs
- Find The LinkedHashSet Size & Check Empty In Java
- Print LinkedHashSet Elements In Java
- Search LinkedHashSet Value In Java
- Remove LinkedHashSet Elements in Java
Hashtable Java Programs
- Hashtable Operation In Java
- Add Values HashTable In Java
- Retain Elements HashTable in Java
- Find Duplicate Value Using HashTable In Java
- Find Element Using containsValue() From Hashtable In Java
- Read Value From Hashtable Key In Java
- Retrieve Hashtable Values Using Keys in Java
HashSet Java Programs
- Add & Retain HashSet Values in Java
- Add & Retrieve From HashSet Using Iterator
- Add Subset Element Into Set Of HashSet In Java
- Find Duplicate Value Using HashSet In Java
- Print Duplicate Character Using HashSet In Java
- Remove Duplicate String using HashSet With Java
- Remove Values From a HashSet In Java
Iterator In Java Programs
- Java iterator
- Retrieve Elements Using Iterator In Collection
TreeMap Java Programs
- Add & Retrieve TreeMap Values Using Java
- Clear TreeMap Values In Java
- Find Treemap Value containsKey() In Java
- Find Treemap Value ContainsValue() In Java
- Retrieve Treemap Values Using Key In Java
- Treemap add and remove Different Methods
TreeSet Java Programs
- Create TreeSet from List In Java
- Remove Duplicate Values TreeSet Java
- Remove Duplicate Values From Array Using TreeSet
- TreeSet Different Methods Used In Java
Vector Java Programs
- Basic Vector Operations In Java
- Add & Retrieve Element In Vector
- Retrieve Vector Elements Using Enumeration
- Add Elements in Vector and Retrieve Using Enumeration
Java Programs Using Collection
- Find Duplicate Character & Count In A String Using Map
- Remove Duplicate Number With Out Using Java Collection
- Print Duplicate Character & Count-In Java
- Find Duplicate Character Counts In Java
- Find Out No Of Occurrence Of a Character
- Find out ReflectionAPI Example Program
- How to Find Duplicate Element In An Array Using Collection In Java
- How to reverse a string in java?
- How to create a pyramid of numbers in java?
- How do you remove all white spaces from a string in java?
- How to find duplicate characters in a string in java?
- How do you check the equality of two arrays in java?
- Anagram program in java
- Armstrong number program in java
- How to find duplicate elements in an array?
- How to find the sum of all digits of a number in java?
- How to find the second largest number in an integer array?
- How to perform matrix operations in java?
- How to count occurrences of each character in a string in java?
- How to find the largest number less than a given number and without a given digit?
- How to find all pairs of elements in an array whose sum is equal to a given number?
Read Also: Some Basic Java Array Programs For Freshers
- How to find a continuous sub-array whose sum is equal to the given number?
- How to remove duplicate elements from ArrayList in java?
- How to check whether the given number is binary or not?
- How to check whether one string is a rotation of another in java?
- How to find an intersection of two arrays in java?
- How to check whether the user input is number or not in java?
- How to find trigonometric values of an angle in java?
- How to reverse each word of a string in java?
- How to separate zeros from non-zeros in an array?
- Decimal To Binary, Decimal To Octal And Decimal To HexaDecimal In Java
- How to find all the leaders in an integer array in java?
- Reverse and add until you get a palindrome
- Selection sort in java
- Reverse the string with preserving the position of spaces
- Roman equivalent of a decimal number
- Percentage of uppercase, lowercase, digits and special characters in a string
- Launch external applications through java code
- Find the missing number in an array
- String immutable program
- Arrays.deepToString() method example.
- Java ArrayList Programming Examples.
- Java LinkedList Programming Examples.
- Detection of deadlocked threads
- Generate random numbers
- Java PriorityQueue Example.
- Java HashSet Example.
- Java LinkedHashSet Example.
- Java TreeSet Example.
- How to sort a text file in java?
- Array to ArrayList and ArrayList To Array Conversion program.
Read Also: Top 10 Common Number Pattern Programs
- How do you find the longest substring without repeating characters in a string?
- How do you count occurrences of each element in an array?
- Reverse an array.
- Write a java program to swap two string variables without using a third or temp variable?
- Write a java program to find the most repeated word in a text file?
- How do you stop a thread in java?
- Remove duplicate elements from an array.
- Write a java program to append text to a file?
- How do you synchronize ArrayList, HashSet, and HashMap in java?
- Write a java program to find a number of characters, number of words, and the number of lines in a text file?
- How do you convert HashMap to ArrayList in java?
- Write a java program to sort an ArrayList?
- Write a java program to find all permutations of a string recursively?
- Write a java program to check whether a given number belongs to the Fibonacci series or not?
- Java HashMap programming examples.
- Write a java program to print Floyd’s Triangle?
- Find The First Repeated And Non-Repeated Character In A String?
- Write a java program to create a spiral of numbers or spiral matrix or circular matrix of order n*n in both clockwise and anti-clockwise directions?
- String to Integer and Integer to String Conversion program.
We Hope This series Of Java programs will help you face any Java programming question in the interview. We know this is a small amount of question out of the Vast Programming language Java. But by joining you are and our hands, we can try to reach 100%. So keep sharing the questions and solutions if you have.