Java Programs

This page includes various Java programs covering all the Java topics such as control statements, strings, arrays, loops, classes, functions, matrix, etc. For all the Java programs, we provide multiple examples along with the screenshot to see the result.

Simple Java Programs

Please visit our Java Tutorial section to learn Java Programming with examples.

  1. Java Program to Print Hello World
  2. Java Program to add Two Numbers
  3. Java Program to find Compound Interest
  4. Java Program to check Number Divisible by 5 and 11
  5. Java Program to find Cube of a Number
  6. Java program to print Even Numbers from 1 to N
  7. Java program to find GCD of a Number
  8. Java Program to find Largest of Two Numbers
  9. Java Program to find largest of Three Numbers
  10. Java program to find LCM of a Number
  11. Java Program to print Multiplication Table
  12. Java program to print Odd Numbers from 1 to N
  13. Java Odd Even Program
  14. Java program to find Positive or Negative Number
  15. Java program to find Power of a Number
  16. Java program to calculate Profit or Loss
  17. Java program to print 1 to 100 without using Loops
  18. Java program to find Roots of a Quadratic Equation
  19. Java program to find Square of a Number
  20. Java program to find Square Root of a Number
  21. Java program to calculate Simple Interest
  22. Java program to find Sum of Even Numbers
  23. Java program to find Sum of Odd Numbers
  24. Java program to calculate Student Grade
  25. Java program to find Sum of Even and Odd Numbers
  26. Java program to find Total Average and Percentage of Five Subjects

Character Programs in Java

  1. Java program to find ASCII Value of a Character
  2. Java program to find ASCII value of all Characters
  3. Java program for String Comparison

Java Number Programs

  1. Java program to check Armstrong Number
  2. Java program to count Digits in a Number
  3. Java Electricity Bill Program
  4. Java program to find Factors of a Number
  5. Java Factorial Program
  6. Java Fibonacci Series
  7. Java program to find First Digit of a Number
  8. Java program to find First and Last Digit of a Number
  9. Java program to find Generic Root of a Number
  10. Java program to find Last Digit of a Number
  11. Java program to print Natural Numbers from 1 to N
  12. Java program to print Natural Numbers in Reverse Order
  13. Java Perfect Number Program
  14. Java Palindrome Program
  15. Java program to check Prime Number or Not
  16. Java program to print Prime Numbers from 1 to N
  17. Java program to find Sum of Prime Numbers from 1 to N
  18. Java program to Reverse a Number
  19. Java program to check Strong Number
  20. Java program to find Sum of Digits in a Number
  21. Java program to find Sum of Natural Numbers from 1 to N
  22. Java program to Swap Two Numbers

Java Area Programs

The following are the list of java programs to find

  1. Java program to find Area of a Circle
  2. Java program to find Area Of a Triangle
  3. Java program to find Area Of a Trapezoid
  4. Java program to find Area of a Equilateral Triangle
  5. Java program to find Area of a Rectangle
  6. Java program to find Area of a Right Angled Triangle

Java Volume and Surface Area Programs

The following are the Java programs to find the Surface area and Volume of the given data.

  1. Java program to find Volume and Surface Area of Sphere
  2. Java program to find Volume and Surface Area of a Cylinder
  3. Java program to find Volume and Surface Area of Cube
  4. Java program to find Volume and Surface Area of Cuboid
  5. Java program to find Volume and Surface Area of Cone

Java String Programs

  1. Java program to print Characters in a String
  2. Java program to print ASCII values of String Characters
  3. Java program to concat Strings
  4. Java program to convert Lowercase to Uppercase
  5. Java program to convert Uppercase to Lowercase
  6. Java program to count Total Characters in a String
  7. Java program to count Total Words in a String
  8. Java Counting Alphabets Digits & Special Characters in a String
  9. Java program to count Vowels and Consonants in a String
  10. Java program to count Total Occurrence of Character in a String
  11. Java program to find All Occurrences of a Character in a String
  12. Java program to find First Character Occurrence in a String
  13. Java program to find Last Character Occurrence in a String
  14. Java program to Find Maximum Occurring Character in a String
  15. Java program to Find Minimum Occurring Character in a String
  16. Java program to find Frequency of each Character in a String
  17. Java program to check Palindrome String
  18. Java program to print First and Last Character in a String
  19. Java program to remove All Occurrences of a Character in a String
  20. Java program to remove First and Last Character in a String
  21. Java program to remove First Character Occurrence in a String
  22. Java program to Remove Last Character Occurrence in a String
  23. Java program to replace First Character Occurrence in a String
  24. Java program to replace Last Character Occurrence in a String
  25. Java program for String Reverse
  26. Java program to Toggle All Characters in a String

Java Conversion programs

  1. Java program to Convert Double to String
  2. Java program to Convert Int to Double
  3. Java Program to Convert Int to Long
  4. Java program to Convert Float to String
  5. Java program to Convert String to Double
  6. Java Program to Convert String to Float
  7. Java program to Convert String to Long

Java Date Programs

  1. Java Leap Year Program
  2. Java program to print Number of Days in a Month

Java Array Programs

  1. Java Program to Print Array Elements
  2. Java program to perform Arithmetic Operations on Array
  3. Java program to copy an Array to another
  4. Java program to Count Even Numbers in an Array
  5. Java program to Count Even and Odd Numbers in an Array
  6. Java program to Count Odd Numbers in an Array
  7. Java program to Count Positive Array Numbers
  8. Java program to Count Negative Array Numbers
  9. Java program to Count Positive and Negative Numbers in an Array
  10. Java program to Count Array Duplicates
  11. Java program to Delete Array Duplicates
  12. Java program to print Largest Array Number
  13. Java program to print Largest and Smallest Array Number
  14. Java program to Print Negative Array Numbers
  15. Java program to Print Positive Array Numbers
  16. Java program to Put Positive and Negative Numbers in Separate Array
  17. Java program to print Second Largest Array Number
  18. Java program to print Smallest Array Number
  19. Java program to Sort Array Elements in Ascending Order
  20. Java program to Sort Array Elements in Descending Order
  21. Java program to find Sum of All Elements in an Array
  22. Java program to find Sum of Even Numbers in an Array
  23. Java program to find Sum of Even and Odd Numbers in an Array
  24. Java program to find Sum of Odd Numbers in an Array
  25. Java program to Swap Two Array without using Temp Variable
  26. Java program to print Unique Array Items

Java Matrix Programs

  1. Java Program to Print Matrix Items
  2. Java program to perform Arithmetic operations on Matrix
  3. Java program to Add Two Matrices
  4. Java program to Check Two Matrices are Equal
  5. Java program to Calculate Determinant of a Matrix
  6. Java program to check Identity Matrix
  7. Java program to Interchange Matrix Diagonals
  8. Java program to print Lower Triangle of a Matrix
  9. Java program to Multiply two Matrices
  10. Java program to perform Scalar Matrix Multiplication
  11. Java program to check Sparse Matrix
  12. Java program to Subtract two Matrices
  13. Java program to find Sum of the Matrix Lower Triangle
  14. Java program to find Sum of the Matrix Upper Triangle
  15. Java program to find Sum of Matrix Opposite Diagonal
  16. Java program to find Sum of Matrix Diagonal
  17. Java program to find Sum of each Matrix Column
  18. Java program to find Sum of each Matrix Row
  19. Java program to find Sum of Matrix Rows and Column
  20. Java program to check Symmetric Matrix
  21. Java program to Transpose Matrix
  22. Java program to print Upper Triangle of a Matrix

Java Star Pattern Programs

  1. Java program to print Rectangle Star Pattern
  2. Java program to print Square Star Pattern

Java Number Pattern Programs

  1. Java program to print Box Number Pattern of 1 and 0
  2. Java program to print Floyd’s Triangle
  3. Java program to print Hollow Box Number Pattern
  4. Java program to print Square Number Pattern

Comments are closed.