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 Duration box, located on the Transitions tab, is used to specify the number of times an animated GIF can loop
Indicate whether the statement is true or false
Public-key cryptography is asymmetric, involving the use of two separate keys, in contrast to ___________ encryption, which uses only one key.
Fill in the blank(s) with the appropriate word(s).