Java Practice ProgramsJava is a popular programming language that is used to develop a wide variety of applications. One of the best ways to learn Java is to practice writing programs. Many resources are available online and in libraries to help you find Java practice programs. When practising Java programs, it is important to focus on understanding the concepts behind the code. Don't just copy and paste code from a website or book. Try to understand why the code is written the way it is. It will help you become a better Java programmer. Java Basic Programs- Fibonacci series in Java
- Factorial Program in Java
- Palindrome Program in Java
- How to reverse String in Java
- How to Reverse a Number in Java
- How do you find duplicate characters in a string
- How to Print ASCII Value in Java
- How to Create Object in Java
- How to Compare Two Objects in Java
- Program to swap two numbers
- Java Program to Find Sum of Natural Numbers
- Java Program to Display Odd Numbers From 1 to 100
- Sum of Numbers in Java
- Java Program to Find Largest of Three Numbers
- Java Program to Check if a Given Number is Perfect Square
- Java Program to Check if a Number is Positive or Negative
Java Number Programs- Special Number in Java
- Perfect Number Program in Java
- Prime Number Program in Java
- Armstrong Number in Java
- Lucky Number in Java
- Spy Number in Java
- Evil Number Java
- Duck Number Java
- ISBN Number Java
- Krishnamurthy Number Java
- Xylem and Phloem Number in Java
- Kynea Numbers in Java
- House Numbers in Java
- Tribonacci Number Java
- Odious Number in Java
- Strontio Number in Java
- Tech Number in Java
- Fascinating Number in Java
- Sunny Number in Java
- Automorphic Number Program in Java
- Mystery Number in Java
- Lead Number in Java
- Bouncy Number in Java
- Economical Number in Java
- Neon Number in Java
- Unique Number in Java Program
- Power of a Number in Java
- Magic Number in Java
- Catalan Number in Java
- Self-Descriptive Numbers in Java
- Hogben Numbers in Java
- Centered Square Numbers in Java
- Nude Numbers in Java
- Sphenic Number in Java
- Program to determine whether a given number is a happy number
- Amicable Pair Number in Java
- Achilles Number in Java
- Frugal Number in Java
- Cullen Number in Java
- Smith Number in Java
- Tetranacci Number in Java
- Undulating Number in Java
- Moran Numbers in Java
- Cardinal Number in Java
- Pyramidal Number in Java
- Buzz Number Java
- Bell Number in Java
- Pancake Number in Java
- Sublime Number in Java
- Ramanujan Number or Taxicab Number in Java
- Untouchable Number in Java
- Pernicious Number in Java
- Narcissistic Number in Java
- Keith Number in Java
- Goldbach Number in Java
- Mersenne Number in Java
- Adam Number in Java
Data structuresJava Array Programs- Java Program to sort the elements of an array in ascending order
- Program to print the elements of an array
- Program to print the elements of an array in reverse order
- Program to print the largest element in an array
- Program to print the duplicate elements of an array.
- Character Array in Java
- How to Take Array Input in Java
- Program to print the smallest element in an array
- Program to print the elements of an array
- Java Program to right rotate the elements of an array
- Java Program to print the sum of all the items of the array
- Java Program to print Odd and Even Numbers from an Array
- Java Program to remove duplicate element in an Array
- Program to copy all elements of one array into another array
- Jagged Array in Java
- Minimum Difference Subarrays in Java
- Beautiful Array in Java
- Dynamic Array in Java
- Iterate JSON Array Java
- String Array in Java
- Java ArrayList
- How to Create Array of Objects in Java
- Static Array in Java
- Java Program to find Largest Number in an Array
- Java Program to find Second Largest Number in an Array
- Java Program to sort the elements of an array in descending order
- Java Program to find Smallest Number in an Array
- Java Program to find Third Largest Number in an Array
- Program to print the duplicate elements of an array
- Passing Array to Function In Java
- Program to left rotate the elements of an array
- Add elements to Array in Java
- Program to print the sum of all the elements of an array
- Java Program to find Second Smallest Number in an Array
- Program to find the frequency of each element in the array
- Program to print the elements of an array present on even position
- Java Program to print the number of elements present in an array
- Array Rotation in Java
- Array Slicing in Java
- How to Create a Mirror Image of A 2D Array in Java
- Program to print the elements of an array present on odd position
- Peak Index of Mountain Array Problem in Java
- Plus One to Array Problem in Java
- Zigzag Array in Java
- Java Array Clone
- Find unique elements in array Java
- Java Program to Count the Occurrences of Each Character
- Program to copy all the elements of one array into another array
- Equilibrium Index of an Array in Java
Java Singly linked list Programs- Java Program to create and display a singly linked list
- Java program to create a singly linked list of n nodes and count the number of nodes
- Java Program to search an element in a singly linked list
- Java program to insert a new node at the end of the singly linked list
- Java program to insert a new node at the beginning of the singly linked list
- Java program to create a singly linked list of n nodes and display it in reverse order
- Java Program to insert a new node at the middle of the singly linked list
- Program to sort the elements of the singly linked list
- Java program to delete a node from the beginning of the singly linked list
- Java program to remove duplicate elements from a singly linked list
- Java program to delete a node from the end of the singly linked list
- Java program to determine whether a singly linked list is the palindrome
- Program to swap the last element of the singly linked list from the first one
- Program to find the maximum and minimum value node from a singly linked list
- Program to swap nodes in a singly linked list without swapping data
- Insertion in singly linked list at beginning
- Java program to delete a node from the middle of the singly linked list
- Program to delete a new node from the beginning of the singly linked list
- Program to search an element in a singly linked list
- Searching in singly linked list
- Deletion in singly linked list at beginning
Java Doubly Linked List Programs- Program to create and display a doubly linked list.
- Java program to create a doubly linked list of n nodes and display it in reverse order
- Java program to insert a new node at the end of the Doubly Linked List
- Java program to insert a new node at the middle of the Doubly Linked List
- Java program to sort the elements of the doubly linked list
- Java program to delete a new node from the beginning of the doubly linked list
- Java program to remove duplicate elements from a Doubly Linked List
- Java program to search an element in a doubly linked list
- Java program to rotate doubly linked list by N nodes
- Java program to convert a given binary tree to doubly linked list
- Program to insert a new node at the beginning of the doubly linked list.
- Java program to delete a new node from the middle of the doubly linked list
Java Circular Linked List Programs- Program to create and display a circular linked list
- Java program to sort the elements of the Circular Linked List
- Java program to search an element in a Circular Linked List
- Java program to create a Circular Linked List of N nodes and count the number of nodes
- Java program to insert a new node at the end of the Circular Linked List
- Java program to insert a new node at the middle of the Circular Linked List
- Java program to insert a new node at the beginning of the Circular Linked List
- Java program to delete a node from the beginning of the Circular Linked List
- Java program to delete a node from the end of the Circular Linked List
- Java program to delete a node from the middle of the Circular Linked List
Java Tree Programs- Java program to construct a Binary Search Tree and perform deletion and In-order traversal
- Java program to implement Binary Tree using the Linked List
- Java program to search a node in a Binary Tree
- Java program to find the maximum depth or height of a tree
- Java program to determine whether two trees are identical
- Java program to find the sum of all the nodes of a binary tree
- Java program to find the largest element in a Binary Tree
- Program to search a node in a Binary Tree
- Java program to create a doubly linked list from a ternary tree
- Java program to find the smallest element in a tree
- Segment Tree in Java
- Level Order Traversal of a Binary Tree in Java
- Morris Traversal for Inorder in Java
- Tree traversal (Inorder, Preorder an Postorder)
- Preorder Traversal
- Inorder Traversal
- Postorder Traversal
- Binary Tree Traversal in Data Structure
- Level Order Traversal of a Binary Tree in Java
- Zigzag Traversal of a Binary Tree in Java
- Vertical Order Traversal of a Binary Tree in Java
- Morris Traversal for Inorder in Java
- Morris Traversal for Preorder in Java
- Level Order Traversal in Spiral form
- Red Black Tree Java
- Level order Traversal in a Binary Tree
- Boundary Traversal of Binary tree
Java String Programs- Java Program to find all the permutations of a string
- Java Program to separate the Individual Characters from a String
- Java Program to find Reverse of the string
- Java Program to count the total number of characters in a string
- Java Program to find all subsets of a string
- Java Program to determine whether one string is a rotation of another
- Write a Java program to count the number of words in a string
- Java Program to find maximum and minimum occurring character in a string
- Java Program to toggle each word in String
- Java Program to determine whether two strings are the anagram
- Program to print smallest and biggest possible palindrome word in a given string
- Java Program to swap two string variables without using third or temp variable
- Java Program to remove all the white spaces from a string
- Java Program to replace lower-case characters with upper-case and vice-versa
- Java Program to count the total number of vowels and consonants in a string
- Palindrome Partitioning Problem in Java
- Isomorphic String in Java
- Display Leaf nodes from Preorder of a BST in Java
Error and Exception Programs- Java throw Exception
- Java Custom Exception
- Arithmetic Exception in Java
- Exception Class in Java
- InputMismatchException in Java
- Java Exception Propagation
- Java try-catch block
- customized exception in Java
- Java finally block
- How to avoid null pointer exception in Java
- ConcurrentModificationException in Java
- FileNotFoundException in Java
- Different Ways to Print Exception Message in Java
- How to resolve IllegalStateException in Java
- Exception Handling with Method Overriding in Java
- Java 7 Catch Multiple Exceptions
- NoClassDefFoundError in Java
- ClassCast Exception in Java
- Java Console Error
- Identifier Expected Error in Java
- Java Catch Multiple Exceptions
- lang.NoSuchMethodError
- Chained Exceptions in Java
- StringIndexOutOfBoundsException in Java
- NZEC in Java
- NoSuchElementException in Java
- Exception in Thread Main java.util.NoSuchElementException no line Found
- How to Create Test Cases for Exceptions in Java
Class and Interface Programs- How to Create Singleton Class in Java
- Types of Classes in Java
- Marker Interface in Java
- ByteStream Classes in Java
- Dictionary Class in Java
- Abstract class in Java
- Wrapper classes in Java
- Java Inner Classes (Nested Classes)
- Java Math class
- Java StringBuffer Class
- Java Scanner
- Java static nested class
- Java FileInputStream Class
- Java FileReader Class
- Java Member Inner class
- Java Console Class
- How to create Immutable class
- Exception Class in Java
- Sealed Class in Java
- Why We Use Static Class in Java
- Singleton Class in Java
- Java Nested Interface
- Java Functional Interfaces
- Java Comparable interface
- Iterator in Java
- Java Runnable Interface
- Marker Interface in Java
- Servlet Interface
- Java 9 Private Interface Methods
- Java Predicate Interface
- Java Consumer Interface
- Lock Interface in Java
- TypeScript Interface
- if Condition in Lambda Expression Java
- How to Mock Lambda Expression in Java
- How to Return Value from Lambda Expression Java
- AWS Lambda in Java
Java Matrix Programs- Java Program to add two matrices
- Java Program to transpose matrix
- Java Program to multiply two matrices
- Java Program to display the lower triangular matrix
- Java Program to find the sum of each row and each column of a matrix
- Java Program to determine whether a given matrix is an identity matrix
- Java Program to display the upper triangular matrix
- Java Program to determine whether a given matrix is a sparse matrix
- Rotate Matrix by 90 Degrees in Java | Rotate Matrix in Java Clockwise and Anti-clockwise
- Normal and Trace of a Matrix in Java
- Java Program to Print Matrix in Z Form
- Set Matrix Zeros in Java
- Find Saddle Point of a Matrix in Java
- Print Matrix Diagonally in Java
- Rotate A Matrix By 180 Degree in Java
- Find Saddle Point of a Matrix in Java
- Program to print the elements of an array in reverse order
- Set Matrix Zeros in Java
- Java Program to subtract the two matrices
Java Pattern programs- Alphabet Pattern in Java
- Ladder Pattern in Java
- Fish Pattern in Java
- Zig Zag Star and Number Pattern in Java
- Heart Pattern in Java
- Butterfly Pattern in Java
- Crown Pattern in Java
- Swastika Pattern in Java
- Christmas Tree Pattern in Java
- Java Program to Print Spiral Pattern
- Print Pencil Shape Pattern in Java
Java Conversion Programs- Java Convert String to int
- Java Convert int to String
- Java Convert Binary to Decimal
- Java Convert int to char
- Java Convert Decimal to Binary
- Java Convert long to int
- Java long to String
- Convert Roman to Integer in Java
- Java Convert int to long
- Java Convert String to double
- Java Convert String to char
- Java Binary to Hexadecimal Conversion
- Java Convert Decimal to Octal
- Java String to Date
- Java Convert char to String
- Convert Integer to Roman Numerals in Java
- Convert IP to Binary in Java
- Program to convert Celsius into Fahrenheit
- Program to convert Fahrenheit into Celsius
- Java Convert int to double
- Java Convert Octal to Decimal
- Program to convert hours into minutes and seconds
- Program to Convert m to Feet and Inches
- Program to Convert Inches to cm
- Program to Convert cm to Feet and Inches
- Java Program Number to Word
- Java Convert Decimal to Hexadecimal
- Program to Convert Inches to meter
- Program to Convert Meter to Centimeter
- Java Convert boolean to String
- Program to Convert Feet to cm
- Program to Convert mm to cm
- Program to Convert millimeter to Feet
- Program to Convert Feet to m
- Java Convert char to int
- Java Convert double to int
- Program to Convert Feet to Inches
- Program to convert temperature degree from Celsius to Kelvin
- Java String to float
- How to convert byte array to String in Java
- Java Convert String to boolean
- Program to Convert Inches to Feet
- Java Hexadecimal to Binary Conversion
- Java Convert double to String
- How to convert String to String array in Java
Java Game Programs- Tetris Game in Java
- Stone Game in Java
- Sudoku in Java
- FizzBuzz Program in Java
- Puzzle Game in Java
- Example of Pic Puzzle Game
- Tic Tac Toe Game in Java
File Handling programs- How to Create a File in Java
- How to delete a file in Java
- How to Read CSV File in Java
- Java FileWriter Class
- Java File Extension
- Java FileReader Class
- How to Read Excel File in Java
- Java Program to find the number of the words in the given text file
- Java FileInputStream Class
- Copy Content/ Data From One File to Another in Java
- Java Get File Size
- Java Program to find the most repeated word in a text file
- Java - RandomAccessFile
- How to read file line by line in Java
- Read PDF File in Java
- How to Create Zip File in Java
- Java Program to find the most repeated word in a text file
- How to make an executable jar file in Java
- Java File Upload to a Folder
- Java Create Jar Files
- List All Files in a Directory in Java
- Zipping and Unzipping Files in Java
- Java SFTP | File Transfer Using SFTP in Java JSCH
- Example to retrieve file from Oracle database
|