This project showcases the extensive usage of the Java Collection Framework, which provides a unified architecture for representing and manipulating collections. It includes examples of various data structures such as lists, sets, and maps, along with advanced features like concurrent collections and custom implementations.
- Detailed examples of
List,Set, andMapimplementations. - Demonstrations of Java 8 Stream API, including intermediate and terminal operations, lazy evaluation, and parallel streams.
- Examples of concurrent collections such as
ConcurrentHashMap,CopyOnWriteArrayList,ConcurrentLinkedQueue, andBlockingQueue. - Custom implementations like an LRU Cache.
- Usage of specialized collections like
IdentityHashMap,WeakHashMap,EnumMap, andImmutableMap. - Insights into Java features like garbage collection, hashCode and equals methods, and more.
CollectionFramework/
├── src/
│ ├── StreamsEx/
│ │ ├── CollectorsEx.java # Examples of Collectors in Streams
│ │ ├── IntermediateOps.java # Demonstrates intermediate operations in Streams
│ │ ├── Java8Intro.java # Features of Java 8
│ │ ├── LazyEvaluationEx.java # Explains lazy evaluation in Streams
│ │ ├── ParallelStreamsEx.java # Examples of parallel stream processing
│ │ ├── PrimitiveStreamsEx.java # Usage of primitive streams like IntStream
│ │ ├── StreamJavaEx.java # General Stream API examples
│ │ ├── TerminalOps.java # Demonstrates terminal operations in Streams
│ │
│ ├── ArrayListEx.java # Examples of ArrayList usage
│ ├── BlockingQueueEx.java # Examples of BlockingQueue
│ ├── ComparableEx.java # Demonstrates Comparable interface
│ ├── ConcurrentHashMapEx.java # Examples of ConcurrentHashMap
│ ├── ConcurrentLinkedDequeEx.java # Examples of ConcurrentLinkedDeque
│ ├── ConcurrentLinkedQueueEx.java # Examples of ConcurrentLinkedQueue
│ ├── ConcurrentSkipListMapEx.java # Examples of ConcurrentSkipListMap
│ ├── CopyOnWriteArrayListEx.java # Examples of CopyOnWriteArrayList
│ ├── CopyOnWriteArraySetEx.java # Examples of CopyOnWriteArraySet
│ ├── DelayQueueEx.java # Examples of DelayQueue
│ ├── DequeEx.java # Examples of Deque
│ ├── EnumMapEx.java # Examples of EnumMap
│ ├── GarbageCollectorEx.java # Demonstrates garbage collection behavior
│ ├── HashCodeAndEqualsMethodEx.java # Demonstrates hashCode and equals() methods
│ ├── HashEx.java # Example of Hash
│ ├── HashMapEx.java # Examples of HashMap usage
│ ├── HashTableEx.java # Examples of Hashtable
│ ├── IdentityHashMapEx.java # Examples of IdentityHashMap
│ ├── ImmutableMapEx.java # Examples of immutable maps
│ ├── IteratorEx.java # Demonstrates Iterator usage
│ ├── LinkedHashMapEx.java # Examples of LinkedHashMap
│ ├── LinkedListEx.java # Examples of LinkedList usage
│ ├── LRUCache.java # Custom implementation of LRU Cache
│ ├── PriorityQueueEx.java # Examples of PriorityQueue
│ ├── QueueEx.java # Examples of Queue interface
│ ├── SetEx.java # Examples of Set interface
│ ├── SortedMapEx.java # Examples of SortedMap
│ ├── StackEx.java # Examples of Stack usage
│ ├── SynchronousQueueEx.java # Examples of SynchronousQueue
│ ├── VectorEx.java # Examples of Vector usage
│ ├── WeakHashMapEx.java # Examples of WeakHashMap
│
├── .gitignore # Git ignore file
└── README.md # Project documentation
- Java Development Kit (JDK) 8 or higher.
- An IDE or text editor of your choice.
- Clone the repository:
git clone https://github.com/yourusername/CollectionFramework.git
- Navigate to the project directory:
cd CollectionFramework
- Open the project in your IDE.
- Compile the Java files:
javac -d bin src/**/*.java
- Run the desired example class:
java -cp bin com.example.collectionframework.<ClassName>
Replace <ClassName> with the specific class you want to execute.
Contributions are welcome! Please fork the repository, make your changes, and submit a pull request.
For any questions or feedback, please contact JohnSunny.