Java Programs for Beginners

This page includes a list of Java programs for beginners to practice and learn Java programming language.
To understand a programming language you must practice the programs, this way you can learn the language faster. This page includes java programs on various java topics such as control statements, loops, classes & objects, functions, arrays, etc. All the programs are tested and provided with the output.

Java Programs on Arrays
Java Program to Remove Duplicate Elements in an Array
Java Program to Find Largest Element in an Array
Java Program to Find Largest Element in an Array
Java Program to Check the Equality of Two Arrays
Java Programs on Strings
Java program to Count Number of Duplicate Words in String
Java Program to Count Number of Words in Given String
Java Program to Count the Number of Occurrences of Substring in a String
Java Program to Count the Occurrences of Each Character in String
Java Program to Merge two String Arrays
Java Program to Reverse a String (5 ways)
Java Program to Reverse Each Word of a String
Java Program to Swap Two Strings
How to Check if the String Contains only Digits
How to Check if the String Contains only Letters
How to Check If the String Contains Only Letters or Digits
Java Program to Check if Input String is Palindrome
Java Program to Find all Permutations of String
How to Remove or Trim All White Spaces from a String in Java
How to Remove Leading and Trailing White Space From a String in Java
Java Program to Count Duplicate Characters in a String
Remove Character from String in Java (Java 8)
Java Program to Count Vowels and Consonants in a String (Java 8)
4 Ways to Find First Non Repeated Character in String in Java
Java Basic Programs
Java Program to Add two Numbers
Java Program to Check Even or Odd Number
Java Program to Multiply two Numbers
Java Program to check Leap Year
Java Program to check whether input character is vowel or consonant
Java Program to Find ASCII Value of a Character
Java Programs on Numbers
Java program to check prime number
Java Program to Check Armstrong Number
Java Program to Find Largest of Three Numbers
Java Program to find the Smallest of three numbers using Ternary Operator
Java Program to Find GCD of Two Numbers
Java Program to Generate Random Number
Java Program to Swap Two Numbers
Java Program to Swap Two Numbers Without using a Temporary Variable
Java Programs on Geometric Calculations
Java Program to Calculate Area of Square
Java Program to Calculate Area of Rectangle
Java program to calculate area of Triangle
Java Programs on Searching Algorithms
Binary Search Algorithm in Java
Linear Search Algorithm in Java
Interpolation Search Algorithm in Java
Java Programs on Sorting Algorithms
Bubble Sort Algorithm in Java
Selection Sort Algorithm in Java
Insertion Sort Algorithm in Java
Java Programs on Searching Algorithms
Merge Sort Algorithm in Java
Quick Sort Algorithm in Java
Java Programs on Stack
Stack Implementation using Array in Java
Dynamic Stack Implementation using Array in Java
Stack Implementation using Linked List in Java
Stack Implementation using Array List
Generic Stack Implementation in Java
Reverse a String using Stack Data Structure in Java
How to Reverse a Stack in Java

Comments