Top 100+ Java Programming Examples With Output

Java Programming Examples With Output | Learn Java Programming Language through examples. Develop java basic programs to understand the basic concepts of Java. These are the basic Java program examples with output. After learning the procedure to develop the program try to develop it on your own and then compare the code given on the website. This page contains frequently, unique and popular Java programs. For all Java programs visit here:- Java Program List

Quick Navigation:- Basic, Flow Control (sum, conversion, series, pattern, number), Array, String, Collection.

Java Basic Programs

The Java basics will teach about variables, data types, how to write basic Java programs, and how to read input values and display them. How to perform basic arithmetic operations in Java, and how to solve basic formula-based problems using Java programming language.

  1. Java Hello World program
  2. Java Addition Program
  3. Average of Two Numbers
  4. Total & Average of 3 Subjects
  5. Calculate Simple Interest
  1. Calculate Compound Interest
  2. Display ASCII value in Java
  3. Calculate Area of Circle in Java
  4. Find Area of Rectangle in Java
  5. Find the Area of Triangle in Java
  1. Swapping two Numbers in Java
  2. Distance Between 2 Points in Java
  3. Simple Mortgage Calculator in Java
  4. Miles to Kilometers Java Program
  5. Unit Conversion Java Program

Java Programming Examples on Flow Control

Java flow control programs are based on conditional control statements (if, if-else and switch-case), loop control statements (while loop, do-while loop, for-loop), and Jump control statements (continue, and break). This section contains multiple Java programs. Some of them are formula-based programs, programs on different types of numbers, different types of printing patterns, flow-control-based conversion programs, and e.t.c.

Array Programs in Java

The array in Java is a referenced data type used to create a fixed number of multiple variables or objects of the same type to store multiple values of similar type in contiguous memory locations with a single variable name. =➤ See all Array Programs in Java

  1. Find Length of Array in Java
  2. Different ways to Print Array
  3. Find the Sum of Array in Java
  4. Average in Java using Array
  5. Sum of Two Arrays Elements
  1. Compare Two Arrays in Java
  2. Copy Array in Java
  3. Merge Two Arrays in Java
  4. Merge Two Sorted Arrays
  5. Largest Number in Array
  1. Smallest Number in Array
  2. 2nd Largest Number in Array
  3. How to Sort an Array in Java
  4. Reverse an Array in Java
  5. GCD of N Numbers in Java
  1. Find LCM of an Array in Java
  2. Linear Search in Java
  3. Binary Search Program in Java
  4. Remove Duplicates From Array
  5. Insert Element at Specific Position
  1. Add Element to Array in Java
  2. Remove Element From Array in Java
  3. Count Repeated Elements in Array
  4. How To Reduce The Size Of An Array In Java
  5. Find Odd Occurrence Number Array in Java
  1. Java Primitive Array To Wrapper Array
  2. Java Array of Random Numbers
  3. Find the Median of an Array Java

Multi-dimensional array and Matrix Programs in Java

  1. Print 2D array in Java
  2. Program to Print 3×3 Matrix 
  3. Sum of matrix elements in Java
  4. Sum of Diagonal Elements of Matrix
  5. Row sum and Column sum of Matrix
  1. Fill 2D Array With Random Numbers
  2. Sort 2D Array In Java
  3. Java Magic Square 2D Array
  4. Java Count Occurrences in 2D Array
  5. How to Find Minimum Value in 2D Array Java
  1. Matrix Addition in Java
  2. Subtraction of two matrices in Java 
  3. Transpose of a Matrix in Java 
  4. Matrix Multiplication in Java
  5. Menu-driven program for Matrix operations

Simple Games using Array

  1. Java Lottery Program Array
  2. Java 2d Array Tic Tac Toe Program

Java Programming Examples on String

  1. Take String Input In Java using Scanner Class
  2. How to Find Length of String in Java
  3. How to Iterate through String Java
  4. Sum of digits in a String
  5. Count No of Vowels String
  1. String Pattern Programs in Java
  2. How To Reverse a String In Java
  3. String Palindrome In Java
  4. Sort String In Java
  5. How to Compare Strings In Java
  1. Check If String Contains Uppercase & Lowercase
  2. Java Check If Char is Uppercase
  3. Check If String is Uppercase Java
  4. Swap Characters in String Java
  5. Generate Random Strings
  1. Java Program to Find Weight of String
  2. Find Second Occurrence of Character in String Java
  3. Find Last Occurrence of Character in String Java
  4. Java Replace nth Occurrence String
  5. Replace Last Occurrence of Character in String Java
  1. How to Replace Dot in Java
  2. How To Remove Substring From String Java
  3. Replace Special Characters In Java
  4. Java Replace String With Escape Character
  5. Java Remove Special Characters From String
  1. How To Remove Character From a String Java
  2. Remove Commas From String Java
  3. Replace Comma in String Java
  4. Golden Ratio Java Program

Number programs using String

  1. Unique Number
  2. Fascinating Number
  3. ISBN Number

String Array Programs

  1. Java Convert Number String to Array
  2. How to Iterate Through a String Array In Java?
  3. Convert String Array to Lowercase Java
  4. String Array to UpperCase Java

Others/Games Programs using String

  1. Hidden Word Java Program
  2. Java Secret Message Program

Collection Java Programming Examples

  1. How to Print Arraylist Without Brackets Java
  2. Unique Digits Count in Java
  3. Java Program for Shopping Bill
  4. Remove Duplicates From ArrayList Java
  5. Sort ArrayList in Java
  6. Convert ArrayList to Byte Array Java
  7. Anagram Program In Java Using List

String Programs with the help of Collection

  1. Print Vowels & Consonants in String
  2. Convert Comma Separated String to List Java
  3. Convert Pipe Delimited String to List Java

Collection & Array Programs

  1. Convert List Of List To 2d Array Java

Other Problems

  1. City Library Fine Report in Java
  2. Drivers License Exam Java Program

Recent


Subscribe

More Programs are coming soon, keep visiting. Subscribe to our newsletter and follow us on Facebook, Instagram, and Twitter to receive the latest tutorial and programs to improve your programming skills.

Keep in Touch