The list of Java programs from beginner to advanced will help you to learn Java programming in an easy way. These Java programs implement the basic concepts of Java such as Object-Oriented Programming, functions, class, exception Handling, loop, array, etc. These Java programming examples are very simple and well explained along with the output.

Java Numbers

  1. Reverse the Number
  2. Prime Number
  3. Twisted Prime
  4. Nth Prime Number
  5. Automorphic Number
  6. Palindrome Number
  7. Neon Number
  8. Pronic Number
  9. Happy Number
  10. Special Number
  11. Fascinating Number
  12. Spy Number
  13. Buzz Number
  14. Nelson Number

Java Number Conversion

  1. Decimal to Binary
  2. Binary to Decimal
  3. Decimal to Octal
  4. Octal to Decimal

Java String

  1. Reverse String
  2. Palindrome String
  3. Pangram String
  4. Count Characters in a String
  5. Count Words in a String
  6. Reverse a Sentence Word by Word
  7. Sort Strings in Alphabetical Order
  8. Frequency of a substring in a string
  9. Check if two String are Anagram
  10. All permutations of a string
  11. Check if String Contains a Special Character in Java
  12. Remove HTML Tags from String
  13. Capitalize the First letter of Each Word in a String
  14. Convert Char Array to a String in Java

Java List and Array

  1. List to array
  2. GCD of array
  3. LCM of array
  4. Sort Elements by Frequency
  5. Array of Objects
  6. Add two Matrices
  7. Multiply two Matrices
  8. Find Duplicates in the Array
  9. Sort ArrayList by Property
  10. Find Most Repeated Element in Array
  11. Reverse Array in Java
  12. Reverse List in Java

Java Patterns

  1. Pascal’s Triangle

Java Mathematics

  1. Calculate Combination in Java
  2. Random Number Generator
  3. Fibonacci Series
  4. Sum of First n Even Numbers
  5. Next Largest Number using same Digits

Java File Handling

  1. Create and Write to File
  2. Read File Line by Line
  3. Copy One File to Another


  1. Tower of Hanoi Java
  2. Java Hacks and Tricks