Last active
August 29, 2015 14:01
-
-
Save jeffbowman/2ab627ac865b8bc799a9 to your computer and use it in GitHub Desktop.
ConfluexBlogSupplierExample2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyIndex implements Supplier<Integer> { | |
private int index = 0; | |
@Override | |
public Integer get() { | |
return index++; | |
} | |
} | |
MyIndex i = new MyIndex(); | |
i.get(); // --> 0 | |
i.get(); // --> 1 | |
i.get(); // --> 2 ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment