subject
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

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 19:20
Number of megabytes of ram in a computer. qualitative or quantitative? because
Answers: 3
question
Computers and Technology, 22.06.2019 08:00
Two technicians are discussing the common u-joint. technician a says its input and output speeds should be equal. technician b says that it normally has two yokes. which technician is correct?
Answers: 1
question
Computers and Technology, 22.06.2019 15:30
What is a costume plot? why is it important to a film or theater production?
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
Light travels at a speed of 186,000 miles a second. the distance light travels in a year is 5,865,690,000,000 miles/year 5,865,695,000,000 miles/year 58,656,950,000,000 miles/year 6,789,000,0000 miles/year
Answers: 1
You know the right answer?
Given the following code, find the compile error. public class Test{
public static void main...
Questions
question
Mathematics, 07.01.2021 03:50
question
English, 07.01.2021 03:50
question
Mathematics, 07.01.2021 03:50
question
Mathematics, 07.01.2021 03:50