Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Java: Which is correct? The student class has two private fields: name and address. It has a method named print as defined below: public void
Java:
Which is correct?
The student class has two private fields: name and address. It has a method named print as defined below: public void print() System.out.println("Name:" + name Address: + address); > The class P is a subclass of Student; it has a field supervisor of String type. It overrides the print method defined in its superclass. It prints the postgraduate's name and address as well as the name of his/her supervisor. Select the correct definition of the print method in the PG class Select one public void print) System.out.println("Name: " super.name = " Address: *+ super address); System.out.println("Supervisor: " + supervisor); public void print) System.out.println("Name: ".name Address: " address); System.out.println("Supervisor: ".supervisor); o public void print) super.print(); System.out.println("Supervisor: ".supervisor); O public void print Student.print(); System.out.println("Supervisor: " supervisor)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started