MCPcopy Create free account
hub / github.com/Anchals24/Low-Level-Design / main

Method main

IteratorDesignPattern/Client.java:7–22  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

5
6public class Client {
7 public static void main(String[] args) {
8 List <Book> booksList = Arrays.asList(
9 new Book(300, "Maths"),
10 new Book (1000, "System Designs"),
11 new Book(560, "DSA"),
12 new Book(345, "UPSC MAINS")
13 );
14
15 LibraryAggregator lib = new LibraryAggregator(booksList);
16 Iterator iterator = lib.createIterator();
17
18 while (iterator.hasNext()){
19 Book book = (Book) iterator.next();
20 System.out.println(book.getBookName());
21 }
22 }
23}

Callers

nothing calls this directly

Calls 4

createIteratorMethod · 0.95
hasNextMethod · 0.95
nextMethod · 0.95
getBookNameMethod · 0.95

Tested by

no test coverage detected