-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAdvJava_Ch15_01_CollectionFramerwork.java
More file actions
37 lines (28 loc) · 1.83 KB
/
AdvJava_Ch15_01_CollectionFramerwork.java
File metadata and controls
37 lines (28 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package AdvancedJava;
public class AdvJava_Ch15_01_CollectionFramerwork {
public static void main(String[] args) {
System.out.println();
// Collection Framework - It consist of different classes and Interfaces, which helps us manage our data in a better and efficient ways
/* Collection Framework vs Arrays -
Arrays are a great way but if we want to manipulate data it causes problems
Eg. If an database is made of certain limit and suddenly new entries are required then the task become challenging.
i.e. tasks like -
1. Inserting an element in between.
2. Deleting an element
3. Applying operation to manipulate data , creates a challenge.
~~ To tackle all these problems we use - Collection Frameworks. */
// These Frameworks are accessible using Classes and even Frameworks. + Some Static Methods.
/* Commonly Used collections - Their uses
1. ArrayList - Data with variable size
2. Set - Distinct collection (No repeated element)
3. Stack - A LIFO data structure (LIFO - Last In , First Out - i.e. like plates , stacked on top of other that is last plate will be the first to be taken)
4. HashMap - For storing key - value pairs (for pairs - Example - [Social Media account 🔗 Password] ). */
// Collection Class is present in java.util package and provides methods for a. Sorting
// b. Searching etc.
// Syntax - java.util.collection
// *********************** //
// Collection Hierarchy can be understood by:
// https://en.wikipedia.org/wiki/Java_collections_framework#/media/File:Java.util.Collection_hierarchy.svg
// *********************** //
}
}