Skip to content

Commit dbe8b9a

Browse files
authored
Update ARCCache.java
Main Method Removed for ARCCache.java
1 parent 0a0130a commit dbe8b9a

File tree

1 file changed

+0
-32
lines changed
  • src/main/java/com/thealgorithms/datastructures/caches

1 file changed

+0
-32
lines changed

src/main/java/com/thealgorithms/datastructures/caches/ARCCache.java

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -68,36 +68,4 @@ private void evict() {
6868
totalCount--;
6969
}
7070
}
71-
72-
public static void main(String[] args) {
73-
74-
// Defining capacity of cache Using Map
75-
ARCCache<String, Integer> cache = new ARCCache<>(5);
76-
cache.put("A", 1);
77-
cache.put("B", 2);
78-
cache.put("C", 3);
79-
cache.put("D", 4);
80-
cache.put("E", 5);
81-
82-
// Printing Cache contents using enhanced for loop
83-
System.out.println("Cache contents:");
84-
for (Map.Entry<String, Integer> entry : cache.cache.entrySet()) {
85-
System.out.println(entry.getKey() + ": " + entry.getValue());
86-
}
87-
88-
// Accessing an existing key
89-
System.out.println("Value of key 'B': " + cache.get("B"));
90-
91-
// Adding a new key
92-
cache.put("F", 6);
93-
94-
// Printing Cache contents after adding Key using enhanced for loop
95-
System.out.println("Cache contents after adding key 'F':");
96-
for (Map.Entry<String, Integer> entry : cache.cache.entrySet()) {
97-
System.out.println(entry.getKey() + ": " + entry.getValue());
98-
}
99-
100-
// Accessing a non existing key
101-
System.out.println("Value of key 'A': " + cache.get("A"));
102-
}
10371
}

0 commit comments

Comments
 (0)