Java Programs

This page has 100+ Java programs with output for beginners to practice. This list of programs is very useful for beginners to learn Java programming by practicing these Java programs.

Java Basic Programs

  1.  Java Binary Search (Recursive and Iterative) Program
  2. Java Happy Birthday Program
  3. Java Program That Calculates the Age of a Person
  4. Java Logical And Or Xor Examples
  5. Java Format Date and Time Examples
  6. Java Convert String to Date and Time
  7. Java Convert Roman to Integer Number
  8. Java Convert Octal to HexaDecimal
  9. Java Convert Octal to Decimal
  10. Java Convert Integer Number to Roman Number
  11. Java Convert Hexadecimal to Binary
  12. Java Convert Decimal to Octal
  13. Java Convert Decimal to Binary
  14. Java Convert Binary to Decimal
  15. Java Convert Binary to an Octal
  16. Java Convert Binary to a Hexadecimal
  17. Java Convert a Unix Timestamp to Date Time
  18. Java Check If Two Integer Arrays are Equals
  19. Java program that removes all white spaces from the given string
  20. Java 8 program that counts the number of vowels and consonants in a given string
  21. Java 8 program that reverses words of a given string
  22. Java Program to Count Number of Digits in an Integer
  23. Java Program Fibonacci Series Using Recursion
  24. Java Program to Find Factorial of a Number
  25. Java program to calculate the area of the Triangle
  26. Java Program to Calculate Area of Square
  27. Java Program to Calculate Area of Rectangle
  28. Java Program to find the Smallest of three numbers using Ternary Operator
  29. Java Program to Find Largest of Three Numbers
  30. Java Program to Find GCD of Two Numbers
  31. Java Program to Check Armstrong Number
  32. Java Program to Generate Random Number
  33. Java Program to check if the Number is Positive or Negative
  34. Java program to check prime number
  35. Java Program to Calculate Simple Interest
  36. Java Program to Swap Two Numbers Without Using a Temporary Variable
  37. Java Program to Swap Two Numbers
  38. Java Program to Find ASCII Value of a Character
  39. Java Program to Check Whether an Alphabet is a Vowel or Consonant
  40. Java Program to check Leap Year
  41. Java Program to Check Even or Odd Numbers
  42. Java Program to Add Two Numbers
  43. Java Program to Swap Two Strings Without Using Third Variable
  44. Java Program to Swap Two Strings with Third Variable
  45. How to Get All Digits from String in Java
  46. Find Duplicate Number in an Array in Java
  47. How to Get a Current Working Directory in Java?
  48. Check Palindrome String in Java
  49. Java Program to Create Pyramid Of Numbers

Java Programs on Strings

Java Programs on Data Structure

DS Stack

DS Queue