Generics2794 - Java Quiz Question


What will be the output of the following program?

public class GenericsWithObjectsDemo {
    public static void main(String args[])
    {
        GenericsWithObjects<float> floatObject = new GenericsWithObjects<float>(33.0F);
        floatObject.print();
    }
}
class GenericsWithObjects<T>
{
    T obj;
    GenericsWithObjects(T obj)
    {
        this.obj = obj;
    }
    void print()
    {
        System.out.println(obj);
    }
}


A
33
B
Some other output
C
Compilation Error
D
Runtime Error