What's the result (output or compile/runtime error/exception) of this?
class B {
String value;
B(String value){
this.value = value;
}
public String toString(){
return value;
}
static void test(A<? extends Object> a){
a.set(new B("foo"));
System.out.println(a.get());
}
public static void main(String[] args){
A<B> a = new A<B>();
test(a);
}
}
class A<T> {
private T o;
void set(T o){
this.o = o;
}
T get(){
return o;
}
}