OnJava8-Examples/generics/CountedObject.java

9 lines
236 B
Java
Raw Normal View History

2015-04-20 15:36:01 -07:00
//: generics/CountedObject.java
public class CountedObject {
private static long counter = 0;
private final long id = counter++;
public long id() { return id; }
public String toString() { return "CountedObject " + id;}
} ///:~