Java Programs Examples

Here I have compiled various java programs examples that will help you to improve your java programming knowledge.


Take Input from User

Addition of Two Numbers

Calculate Simple Interest

Calculate Compound Interest

Swap Two Numbers Using Third Variable

Swap Two Numbers Without Using Third Variable

Calculate Area and Circumference of Circle

Check Even or Odd Number

Find Largest of Three Numbers

Check Leap Year

Convert Decimal to Binary

Convert Binary to Decimal



Calculate Power of Number

Armstrong Number

Reverse a Number

Fibonacci Series

Palindrome Number

Prime Number

Factorial of Number

Pascal Triangle



Insert Element in Array at Specified Position

Find Largest Number in Array Using Recursion



Matrix Addition

Matrix Multiplication

Matrix Inverse



Reverse String

Convert String to Character Array

Check String is Anagram

Split String


Sorting & Searching

Heap Sort

Bubble Sort

Binary Search

Linear Search

Bucket Sort



Sort ArrayList of Objects

Sort ArrayList of String and Integer



Caesar Cipher (Encryption and Decryption)



Encode or Decode URL Parameters

Convert JSON to XML or XML to JSON

Read and Write Properties File

Convert Image to Base64 String or Base64 String to Image

Socket Programming


More programs coming soon!!