The best way to learn Java programming is by practicing examples. The page contains examples on basic concepts of Java. You are advised to take the references from these examples and try them on your own.

All the programs on this page are tested and should work on all platforms.

  1. Java Program to Join Two Lists
  2. Java Program to Convert List (ArrayList) 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 to an array and vice versa
  13. Java Program to Convert the ArrayList into a string and vice versa
  14. Java Program to Iterate over an ArrayList
  15. Java Program to Iterate over a HashMap
  16. Java Program to Iterate over a Set
  17. Java Program to Merge two lists
  18. Java Program to Update value of HashMap using key
  19. Java Program to Remove duplicate elements from ArrayList
  20. Java Program to Get key from HashMap using the value
  21. Java Program to Detect loop in a LinkedList
  22. Java Program to Calculate union of two sets
  23. Java Program to Calculate the intersection of two sets
  24. Java Program to Calculate the difference between two sets
  25. Java Program to Check if a set is the subset of another set
  26. Java Program to Sort map by keys
  27. Java Program to Pass ArrayList as the function argument
  28. Java Program to Iterate over ArrayList using Lambda Expression
  29. Java Program to Implement Binary Tree Data Structure
  30. Java Program to Perform the preorder tree traversal
  31. Java Program to Perform the postorder tree traversal
  32. Java Program to Perform the inorder tree traversal
  33. Java Program to Count number of leaf nodes in a tree
  34. Java Program to Implement the graph data structure