public class GenericStatic<T> {$ javac GenericStatic.java
static String o = "";
String oo() {
return o += "o";
}
public static void main(String[] args) {
GenericStatic<Object> a = new GenericStatic<Object>();
GenericStatic<String> b = new GenericStatic<String>();
System.out.println(a.oo());
System.out.println(b.oo());
}
}
$ java GenericStatic
o
oo
No comments:
Post a Comment