Java Programs



This page has a 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 a 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 area of 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 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 Vowel or Consonant
  40. Java Program to check Leap Year
  41. Java Program to Check Even or Odd Number
  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 Array in Java
  47. How to Get 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

  1. Stack Data Structure in Java
  2. Stack Implementation using Array in Java
  3. Dynamic Stack Implementation using Array in Java
  4. Stack Implementation using Linked List in Java
  5. Stack Implementation using Array List
  6. Generic Stack Implementation in Java
  7. Reverse a String using Stack Data Structure in Java
  8. How to Reverse a Stack in Java

DS Queue

Comments