Important Basic Java Programs

For Beginners

Yuvaraj
2 min readJul 18, 2024
Java Basic Programs

Set 1

  1. Fibonacci Series (with & without recursion)
  2. Prime numbers or Not
  3. Palindrome Number & Palindrome String
  4. Factorial Number
  5. Armstrong Number

Set 2

6. Odd or Even Number

7. Sum of the digits & Sum of the natural numbers

8. Swapping of two numbers (with & without using third variable)

9. Number is strong or not

10. Perfect Number or Not

11. Harshad Number Program

Set 3

12. Matrix Multiplication & Multiplication Table

13. Reversing of Number & Reverse a String (with & without using inbuilt functions)

14. Program to Convert Decimal to Binary & Binary to Decimal + Hexadecimal

15. Program for Leap Year or Not

16. Simple Calculator

17. Area of Circle, Rectangle & Triangle

Set 4

18. Temperature Convertor [Fahrenheit to Celsius] + Vice-Verse

19. Grade Calculator

20. Vowels or Consonants Checker (count vowels and consonants / vowel is present in a string or not)

21. Fizz buzz Program

22. Anagram Checker

Set 5

23. GCD of two numbers & LCM

24. Count Occurrence of a Character in a String

25. Check Two Strings are Relation of Each Other

26. Binary Search Program

27. Bubble Sort Program

Set 6

28. Convert an array into a Zig-zag Pattern

29. Remove & Find Duplicates from an Array

30. Second Largest Element in an Array

31. Find the Missing Number in an Array

32. Merge Sorted Array

Set 7

33. Sum of an Array using Recursion

34. Maximum Subarray Sum (Kadane’s Algorithm)

35. Program for Duplicate Characters in a String

36. Program to Remove all white spaces (with & without using buit in functions)

37. How to solve Diamond Problem in Inheritance Program

38. Pattern Printing (Popular any 5)

39. How to generate random number in Java

Set 8

40. Spy Number in Java

41. Automorphic Number in Java

42. Peterson Number in Java

43. Program to find smallest & largest of three numbers (Using Ternary Operator)

44. Type Conversion Program

--

--