What will be the output of the following program?
class OutPut
{
public static void main(String arg[])
{
Student narayan = new Student("Narayan", 72, 'A');
Student mahesh = new Student("Mahesh", 98, 'C');
Student kiran = new Student("Kiran", 'A');
kiran.print("Kiran", 'A');
narayan.print("Mahesh", 'B', 65);
narayan.print();
}
}
class Student
{
String name;
int marks;
char section;
Student(String name, int marks, char section)
{
this.name = name;
this.marks = marks;
this.section = section;
}
Student(String name, char section)
{
this(name, 0, section);
}
void print()
{
System.out.println("Name = " + name + ", marks = " + marks);
}
void print(String name, char section)
{
System.out.println("Name = " + name + ", section = " + section);
}
void print(String name, char section, int marks)
{
System.out.println("Name = " + name + ", section = " + section + ", marks = " + marks);
}
}