Java Collections Examples
A hands-on collection of Java programs demonstrating the core Collections Framework, with examples for List, Map, and Set.
What’s Inside
- List/ – Examples using
ArrayList,LinkedList, and demonstration of common operations like adding, removing, and iterating. - Map/ – Code snippets for
HashMap,TreeMap, and operations such as putting, retrieving, and iterating over entries. - Set/ – Demonstrations of
HashSetandTreeSet, showcasing unique element storage, ordering, and basic operations.
Tech Stack
- Written in Java (JDK 8+)
- Built using core Java concepts and the Collections API.
Project Structure
Collection/
├── List/
│ └── ... (Java examples using List)
├── Map/
│ └── ... (Java examples using Map)
├── Set/
│ └── ... (Java examples using Set)
└── README.md
Each folder contains runnable Java files that cover:
- Common operations (add, remove, iterate, etc.)
- Example use cases and best practices
- Clone the repository:
git clone https://github.com/Guru1817/Collection.git cd Collection
2.Navigate to any package folder—for example, Map:
cd Map
3.Compile:
javac *.java
4.Run:
java Main # or the appropriate main class
Future Enhancements
-Add examples for Queue, Deque, and PriorityQueue
-Demonstrate Concurrent Collections like ConcurrentHashMap
-Include Java 8+ Stream API usage with Collections
-Add unit tests using JUnit for each example
-Optional: Create a README.md inside each folder with detailed explanations
Contributing
-Contributions are welcome!
-Fork this repository
-Add new examples in the appropriate folder
-Commit your changes with a clear message
-Open a Pull Request
License
This project is open-source under the MIT License.
Author: Gurupada Nayak