What will be the output of the following program?
public class GenericsWithObjectsDemo {
public static void main(String args[]) {
GenericsWithObjects doubleObject = new GenericsWithObjects(12.0);
doubleObject.print();
GenericsWithObjects stringObject = new GenericsWithObjects("MC");
stringObject.print();
}
}
class GenericsWithObjects {
Object obj;
GenericsWithObjects(Object obj) {
this.obj = obj;
}
void print() {
System.out.println(obj);
}
}