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(Student x) {
System.out.println(x.toString());
}
}
class GraduateStudent extends Student {
}
class Student extends Person {
@Override
public String toString() {
return "Student";
}
}
class Person extends Object {
@Override
public String toString() {
return "Person";
}
}```
a. m(new GraduateStudent()) causes an error
b. m(new Student()) causes an error
c. m(new Person()) causes an error
d. m(new Object()) causes an error
cd You cannot pass a supertype variable to a subtype without explicit casting.
You might also like to view...
The Database Documenter tool can provide information about when a field or other object was last modified
Indicate whether the statement is true or false
What type of group is typically used to manage resources in a domain?
A. Local group B. Domain local group C. Global group D. Universal group
A(n) ________ is a collection of related tables forming a database.
Fill in the blank(s) with the appropriate word(s).
Which of the following is used when referring to the capacity of a CD?
A. terabytes B. megabytes C. kilobytes D. gigabytes