请教一个简单的问题# Java - 爪哇娇娃
d*g
1 楼
下面这个知道答案,但是不知道为什么,请教一下,谢谢!
consider the following code fragment:
class MySuperClass {
static void message(){
System.out.println("From the super class!");
}
}
public class MySubClass extends MySuperClass {
7. void message() {
System.out.println("From the sub class!");
}
public static void main(String args[]) {
MySubClass mysub=new MySubClass();
mysub.message();
consider the following code fragment:
class MySuperClass {
static void message(){
System.out.println("From the super class!");
}
}
public class MySubClass extends MySuperClass {
7. void message() {
System.out.println("From the sub class!");
}
public static void main(String args[]) {
MySubClass mysub=new MySubClass();
mysub.message();