Files
java-design-patterns/object-pool/src/main/java/com/iluwatar/App.java

28 lines
999 B
Java
Raw Normal View History

2015-05-24 13:18:08 +03:00
package com.iluwatar;
public class App {
public static void main( String[] args ) {
2015-05-24 21:47:57 +03:00
OliphauntPool pool = new OliphauntPool();
System.out.println(pool);
Oliphaunt oliphaunt1 = pool.checkOut();
System.out.println("Checked out " + oliphaunt1);
System.out.println(pool);
Oliphaunt oliphaunt2 = pool.checkOut();
System.out.println("Checked out " + oliphaunt2);
Oliphaunt oliphaunt3 = pool.checkOut();
System.out.println("Checked out " + oliphaunt3);
System.out.println(pool);
System.out.println("Checking in " + oliphaunt1);
pool.checkIn(oliphaunt1);
System.out.println("Checking in " + oliphaunt2);
pool.checkIn(oliphaunt2);
System.out.println(pool);
Oliphaunt oliphaunt4 = pool.checkOut();
System.out.println("Checked out " + oliphaunt4);
Oliphaunt oliphaunt5 = pool.checkOut();
System.out.println("Checked out " + oliphaunt5);
System.out.println(pool);
2015-05-24 13:18:08 +03:00
}
}