Accessing member variables - Java Quiz Question


What will be the output of the following program?

class College {
    public static void main(String s[]) {
        Student mahesh = new Student();
        System.out.println("Name = " + mahesh.name);
        System.out.println("Marks = " + mahesh.marks);
        System.out.println("Section = " + mahesh.section);
    }
}
class Student {
    String name = "Mahesh";
    int marks = 68;
    char section = 'B';
}


A
Name = Mahesh
Marks = 68
Section = B
B
Name = null
Marks = 0
Section =
C
Compilation Error
D
Runtime Error