Computers and Technology
Computers and Technology, 17.07.2020 05:01, ash3246

Given the following code, find the compile error. public class Test{
public static void main(String[] args){
m(new GraduateStudent());
m(new Student());
m(new Person());
m(new Object());
}
public static void m(Person x){
System. out. println(x. toString());
}
}
class GraduateStudent extends Student {
public String toString(){ return "GraduateStudent";}
}
class Student extends Person{
public String toString(){ return "Student";}
}
class Person extends Object{
public String toString(){ return "Person";}
}
a. m(new Object()) causes an error
b. m(new Person()) causes an error
c. m(new Student()) causes an error
d. m(new GraduateStudent()) causes an error

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 13:30, valeriegarcia12
Select the correct answer from each drop-down menu. which types of computer networks are bigger as well as smaller than a man? a man is a network of computers that covers an area bigger than a , but smaller than a .
Answers: 1
image
Computers and Technology, 24.06.2019 22:30, yaretxi
Telling a computer that is already on to turn again is known as what type of boot?
Answers: 1
image
Computers and Technology, 25.06.2019 03:30, eamber646
Which task should happen during the planning stage of a project
Answers: 2
image
Computers and Technology, 25.06.2019 11:30, salutemeimchloe
In a personal computer, the system software
Answers: 1
Do you know the correct answer?
Given the following code, find the compile error. public class Test{
public static void main...

Questions in other subjects:

Konu
Social Studies, 25.03.2020 05:05
Konu
Mathematics, 25.03.2020 05:05
Konu
Geography, 25.03.2020 05:05