Java Programs with Output
- Java Program to Add Two Numbers
- Java Program to Subtract Two Numbers
- Java Program to Multiply Two Numbers
- Java Program to Divide Two Numbers
- Java Program to Calculate the Area of a Circle
- Java Program to Convert Fahrenheit to Celsius
- Java Program to Calculate the Area of a Triangle
- Java Program to Find the Largest of Three Numbers
- Java Program to Check if a Number is Prime
- Java Program to Find the Fibonacci Series
- Java Program to Calculate Factorial
- Java Program to Reverse a String
- Java Program to Reverse a Number
- Java Program to Count Vowels and Consonants in a String
- Java Program to Calculate Power of a Number
- Java Program to Check if a Number is Positive or Negative
- Java Program to Generate Random Numbers
- Java Program to Calculate Average Using Arrays
- Java Program to Check if a Year is a Leap Year
- Java Program to Find Factorial Using Recursion
- Java Program to Find GCD of Two Numbers
- Java Program to Find LCM of Two Numbers
- Java Program to Generate Prime Numbers Up to N
- Java Program to Display Armstrong Numbers
- Java Program to Find Sum of Natural Numbers
- Java Program to Find Strong Number
- Java Program to Check Palindrome Number
- Java Program to Remove All Whitespaces from a String
- Java Program to Round a Number to n Decimal Places
- Java Program to Convert Binary to Decimal
- Java Program to Convert Decimal to Binary
- Java Program to Convert Decimal to Octal
- Java Program to Calculate Compound Interest
- Java Program to Calculate Simple Interest
- Java Program to Make a Simple Calculator
- Java Program to Swap Two Numbers Without Using a Temp Variable
- Java Program to Find the Second Largest Number in an Array
- Java Program to Find the Second Largest Number in an Array
- Java Program to Count the Number of Digits in an Integer
- Java Program to Sum the Digits of Number
- Java Program to Perform Matrix Multiplication
- Java Program to Find Transpose of a Matrix
- Java Program to Add Two Matrices
- Java Program to Check if a Given Number is Perfect Square
- Java Program to Display Characters from A to Z using Loop
- Java Program to Find Sum of Natural Numbers Using While Loop
- Java Program to Demonstrate the Use of Pre and Post Increment
- Java Program to Merge Two Arrays
String
- Java Program to Reverse a String Using Recursion
- Java Program to Convert String to Date
- Java Program to Convert String to Integer
- Java Program to Compare Two Strings
- Java Program to Find Length of a String
- Java Program to Remove Duplicate Characters from String
- Java Program to Concatenate Two Strings
- Java Program to Check if a String is Empty or Null
- Java Program to Count the Occurrence of Each Character in a String
- Java Program to Check if a String Contains a Substring
- Java Program to Find Duplicate Characters in String
- Java Program to Find Maximum Occurring Character in String
- Java Program to Count Substring Occurrences in a String
- Java Check String Starts with Prefix
- Java Check String Ends with Suffix
- Java Find All Subsets of String
- Java Check if String is Numeric
- Java Count Words in String
- Java Find Duplicate Words in String
- Java Check Palindrome String
- Java Convert CSV to ArrayList
- Java Convert ArrayList to CSV
- Java Trim String
- Java Replace Substring in String
- Java Find Character Frequency in String
- Java Capitalize the First Letter of Words
- Java Find Longest Non-Repeating Substring
- Java Find Shortest All Characters Substring
- Java Merge Two-Sorted String Arrays
- Java Check Anagram Strings
- Java Find All String Permutations
- Java Check Rotated Version of String
- Java Find Longest Palindromic Substring
- Java Convert String to Byte Array
- Java Convert String to Boolean
- Java Convert String to Double
- Java Convert String to Enum
- Java Convert Enum to String
- Java Convert String to JSON
- Java Convert JSON to String
- Java Encode String Using Base64
- Java Decode Base64 String
- Java Perform String Padding
- Java Remove Non-Numeric Characters from String
Array
- Java Find Max Min in Array
- Java Find Duplicate Elements in Array
- Java Merge Arrays into Third Array
- Java Reverse an Array
- Java Perform Binary Search on Array
- Java Rotate an Array
- Java Convert Array to ArrayList
- Java Convert ArrayList to Array
- Java Check Array Contains Value
- Java Remove Duplicate Elements from Array
- Java Intersection of Two Arrays
- Java Union of Two Arrays
- Java Implement Multi-Dimensional Arrays
List, Set, and Map
- Java Clone an Array
- Java List to Set
- Java Set to List
- Java Map Keys to List
- Java Map Values to Set
- Java List to Array
- Java Array to List
- Java Sort List
- Java Sort Set
- Java Sort Map by Key
- Java Sort Map by Value
- Java Filter List
- Java Filter Set
- Java Filter Map
- Java Find in List
- Java Find in Set
- Java Find in Map
- Java Map Reduce List
- Java Map Reduce Set
- Java Map Reduce Map
- Java List to CSV
- Java List to JSON
- Java JSON to List
- Java Set to JSON
- Java JSON to Set
- Java Map to JSON
- Java JSON to Map
- Java Remove Duplicates from the List
- Java Remove Nulls from the List
- Java List Intersection
- Java List Union
- Java Map Merge
- Java Convert List to Map
- Java Custom Sort List
- Java Custom Sort Set
- Java Custom Sort Map
- Java Synchronized List
- Java Synchronized Map
- Java Read-only List
- Java Read-only Set
- Java Read-only Map
- Java Convert Iterable to Stream
- Java Convert Stream to List
- Java Convert Stream to Set
- Java Convert Stream to Map
- Java Convert List of Maps
- Java Convert Map of Lists
- Java Convert Map to Properties
- Java Convert Properties to Map
- Java List Pagination
- Java Set Pagination
- Java Map Pagination
- Java Find Max in List
- Java Find Min in List
- Java Find Max in Set
- Java Find Min in Set
- Java Find Max in Map
- Java List Iteration
- Java Set Iteration
- Java Map Iteration
- Java List to Multimap
- Java Set to Multimap
- Java List Join
- Java Set Join
- Java List GroupingBy
- Java Set GroupingBy
- Java Map GroupingBy
- Java Map GroupingBy
ArrayList
- Java Convert ArrayList to Array
- Java ArrayList Add Element
- Java ArrayList Iterate
- Java ArrayList Sorting
- Java ArrayList Reverse Order
- Java ArrayList SubList
- Java ArrayList Clone
- Java Convert ArrayList to String
- Java ArrayList Search Element
- Java ArrayList Size
- Java ArrayList isEmpty Check
- Java ArrayList Clear
- Java Convert ArrayList to LinkedList
- Java ArrayList Remove Duplicates
- ArrayList Capacity vs Length Difference
- Java ArrayList Get First and Last Element
- Java ArrayList Get Unique Values
LinkedList
- Java LinkedList Add Element
- Java LinkedList Remove Element
- Java Convert LinkedList to Array
- Java LinkedList Contains Element
- Iterate Java LinkedList
- Java LinkedList Reverse
- Java LinkedList Get First and Last Element
- Java LinkedList Set Element
- Java LinkedList Clear
- Java LinkedList Clone
- Java Convert LinkedList to String
- Java LinkedList SubList
- Java LinkedList Size
- Java LinkedList isEmpty Check
- Java LinkedList Search Element
- Java LinkedList Remove Duplicates
- Java Comvert LinkedList to ArrayList
HashSet
- Java HashSet Add Element
- Java HashSet Remove Element
- Java HashSet Contains
- Java Convert HashSet to Array
- Java Convert Array to HashSet
- Java HashSet Clear
- Java HashSet Clone
- Java HashSet Size
- Java HashSet isEmpty
- Java Convert HashSet to TreeSet
HashMap
- Java HashMap Put and Get
- Java HashMap Remove
- Java HashMap ContainsKey
- Java HashMap ContainsValue
- Java HashMap Iteration
- Java Convert HashMap to ArrayList
- Java Convert ArrayList to HashMap
- Java HashMap Clear
- Java HashMap Size
- Java HashMap isEmpty
- Java HashMap KeySet
- Java HashMap Values
- Java HashMap EntrySet
- Java HashMap Sort by Keys
- Java HashMap Sort by Values
- Java HashMap Merge
LinkedHashSet
TreeSet
- Java TreeSet Basic Operations
- Java TreeSet Iteration
- Java TreeSet with Comparator
- Java TreeSet Reverse Order
LinkedHashMap
- Java LinkedHashMap Add Element
- Java LinkedHashMap Remove First and Last Element
- Accessing the Entries of a LinkedHashMap
- Removing Entries from a LinkedHashMap
- Iterating over a LinkedHashMap in Java
TreeMap
- TreeMap with a Custom Comparator (Descending Order)
- Accessing the entries of a TreeMap
- Iterating over a TreeMap in Java
TreeSet
- Creating a TreeSet in Java
- Tree Set with a Custom Comparator (Descending order)
- Accessing the Elements of a TreeSet in Java
- Removing Elements from a TreeSet
- TreeSet with User-Defined Objects
- Iterating over TreeSet in Java
Comparator
- Java Comparator Example Tutorial
- Java Comparator in Descending Order
- Java Comparator in Ascending Order
- Java Comparator with Lambda to Sort in Descending Order
- Java Comparator with Lambda Expressions
- Java Lambda Comparator with Multiple Fields
- Java Comparator in Reverse Order
- Java Comparator Sorting by Multiple Fields
- Java Comparator Handling Null Values
- How to Sort Custom Objects in Java 8
CRUD Operations
- Java ArrayList CRUD Operations Example
- Java LinkedList CRUD Operations Example
- Java HashSet CRUD Operations Example
- Java LinkedHashSet CRUD Operations Example
- Java TreeSet CRUD Operations Example
- Java HashMap CRUD Operations Example
- Java LinkedHashMap CRUD Operations Example
- Java TreeMap CRUD Operations Example
- Java ConcurrentHashMap CRUD Operations Example