Java Basic Programs
1. Java Hello World Program
2. Java program to print an Integer (Entered by the User)
3. Java Program to Add Two Integers
4. Java Program to Multiply two Floating Point Numbers
5. Java Program to Find ASCII Value of a character
6. Java Program to Compute Quotient and Remainder
7. Java Program to Swap Two Numbers
8. Java Program to Check Whether a Number is Even or Odd
9. Java Program to Check Whether an Alphabet is Vowel or Consonant
10. Java Program to Find the Largest Among Three Numbers
11. Java Program to Find all Roots of a Quadratic Equation
1. Java Program to Convert Character to String and Vice-Versa
2. Java Program to convert char type variables to int
3. Java Program to convert int type variables to char
4. Java Program to convert long type variables into int
5. Java Program to convert int type variables to long
6. Java Program to convert boolean variables into string
7. Java Program to convert string type variables into boolean
8. Java Program to convert string type variables into int
9. Java Program to convert int type variables to String
10. Java Program to convert int type variables to double
Decision making and loop
1. Java Program to Check Leap Year
2. Java Program to Check Whether a Number is Positive or Negative
3. Java Program to Check Whether a Character is Alphabet or Not
4. Java Program to Calculate the Sum of Natural Numbers
5. Java Program to Find Factorial of a Number
6. Java Program to Generate Multiplication Table
7. Java Program to Display Fibonacci Series
8. Java Program to Find GCD of two Numbers
9. Java Program to Find LCM of two Numbers
10. Java Program to Display Characters from A to Z using loop
11. Java Program to Count Number of Digits in an Integer
12. Java Program to Reverse a Number
13. Java Program to Calculate the Power of a Number
14. Java Program to Check Whether a Number is Palindrome or Not
15. Java Program to Check Whether a Number is Prime or Not
16. Java Program to Display Prime Numbers Between Two Intervals
17. Java Program to Check Armstrong Number
18. Java Program to Display Armstrong Number Between Two Intervals
19. Java Program to Display Factors of a Number
20. Java Program to Make a Simple Calculator Using switch…case
21. Java Program to Count the Number of Vowels and Consonants in a Sentence
22. Java Program to Sort Elements in Lexicographical Order (Dictionary Order)
23. Java Code To Create Pyramid and Pattern
Java Programs on Functions
-
Java Program to Display Prime Numbers Between Intervals Using Function
-
Java Program to Display Armstrong Numbers Between Intervals Using Function
-
Java Program to Check Whether a Number can be Expressed as Sum of Two Prime Numbers
-
Java Program to Find the Sum of Natural Numbers using Recursion
-
Java Program to Find Factorial of a Number Using Recursion
-
Java Program to Find G.C.D Using Recursion
-
Java Program to Convert Binary Number to Decimal and vice-versa
-
Java Program to Convert Octal Number to Decimal and vice-versa
-
Java Program to Convert Binary Number to Octal and vice-versa
-
Java Program to Reverse a Sentence Using Recursion
-
Java Program to calculate the power using recursion
-
Java Program to Call One Constructor from another
-
Java Program to implement private constructors
-
Java Program to pass lambda expression as a method argument
-
Java Program to pass method call as arguments to another method
-
Java Program to Calculate the Execution Time of Methods
Java Programs on Arrays
- 1. Java Program to Calculate Average Using Arrays
- 2. Java Program to Find Largest Element of an Array
- 3. Java Program to Calculate Standard Deviation
- 4. Java Program to Add Two Matrix Using Multi-dimensional Arrays
- 5. Java Program to Multiply Two Matrix Using Multi-dimensional Arrays
- 6. Java Program to Multiply two Matrices by Passing Matrix to a Function
- 7. Java Program to Find Transpose of a Matrix
- 8. Java Program to Print an Array
- 9. Java Program to Concatenate Two Arrays
- 10. Java Program to Check if An Array Contains a Given Value
Java Programs on Object & Classes
- 1. Java Program to Add Two Complex Numbers by Passing Class to a Function
- 2. Java Program to Calculate Difference Between Two Time Periods
- 3. Java Program to Determine the class of an object
- 4. Java Program to Create an enum class
- 5. Java Program to Print object of a class
- 6. Java Program to Create custom exception
- 7. Java Program to Create an Immutable Class
Java Programs on String
- 1. Java Program to Convert String to Date
- 2. Java Program to Convert a Stack Trace to a String
- 3. Java Program to Compare Strings
- 4. Java Program to Check if a String is Numeric
- 5. Java Program to Check if two strings are anagram
- 6. Java Program to Compute all the permutations of the string
- 7. Java Program to Create random strings
- 8. Java Program to Clear the StringBuffer
- 9. Java Program to Capitalize the first character of each word in a String
- 10. Java Program to Iterate through each characters of the string.
- 11. Java Program to Differentiate String == operator and equals() method
- 12. Java Program to Implement switch statement on strings
- 13. Java Program to Check if a string contains a substring
- 14. Java Program to Check if a string is a valid shuffle of two distinct strings
Java Program on Collections
- 1. Java Program to Join Two Lists
- 2. Java Program to Convert a List to Array and Vice Versa
- 3. Java Program to Convert Map (HashMap) to List
- 4. Java Program to Convert Array to Set (HashSet) and Vice-Versa
- 5. Java Program to Sort a Map By Values
- 6. Java Program to Sort ArrayList of Custom Objects By Property
- 7. Java Program to Implement LinkedList
- 8. Java Program to Implement stack data structure
- 9. Java Program to Implement the queue data structure
- 10. Java Program to Get the middle element of LinkedList in a single iteration
- 11. Java Program to Convert the LinkedList into an Array and vice versa
- 12. Java Program to Convert the ArrayList into a string and vice versa
- 13. Java Program to Iterate over an ArrayList
- 14. Java Program to Iterate over a HashMap
- 15. Java Program to Iterate over a Set
- 16. Java Program to Merge two lists
- 17. Java Program to Update value of HashMap using key
- 18. Java Program to Remove duplicate elements from ArrayList
- 19. Java Program to Get key from HashMap using the value
- 20. Java Program to Detect loop in a LinkedList
- 21. Java Program to Calculate union of two sets
- 22. Java Program to Calculate the intersection of two sets
- 23. Java Program to Calculate the difference between two sets
- 24. Java Program to Check if a set is the subset of another set
- 25. Java Program to Sort map by keys
- 26. Java Program to Pass ArrayList as the function argument
- 27. Java Program to Iterate over ArrayList using Lambda Expression
- 28. Java Program to Implement Binary Tree Data Structure
- 29. Java Program to Perform the preorder tree traversal
- 30. Java Program to Perform the postorder tree traversal
- 31. Java Program to Perform the inorder tree traversal
- 32. Java Program to Count number of leaf nodes in a tree
- 33. Java Program to Implement the graph data structure
- 34. Java Program to Remove elements from the LinkedList.
- 35. Java Program to Add elements to a LinkedList
- 36. Java Program to Access elements from a LinkedList.