62,615
社区成员
发帖
与我相关
我的任务
分享
public class test {
public static void main(String[] args) {
String s1 = new String("123");
String s2 = new String("123");
System.out.println(s1.hashCode());
System.out.println(s2.hashCode());
Object obj1 = new Object();
Object obj2 = new Object();
System.out.println(obj1.hashCode());
System.out.println(obj2.hashCode());
}
}
/**
* 爷爷类
*/
public class Grandfather {
public void skill() {
System.out.println("爷爷十八拳");
}
}
/**
* 父亲类
*/
public class Parent extends Grandfather {
@Override
public void skill() {
super.skill();
}
}
/**
* 孩子类
*/
public class Chirdren extends Parent {
@Override
public void skill() {
super.skill();
}
}
/**
* 测试
*/
public class Test {
public static void main(String[] args) {
Chirdren c = new Chirdren();
c.skill();
}
}