62,614
社区成员
发帖
与我相关
我的任务
分享
package lzhw;
class Super
{
int a=10;
void hi()
{
System.out.println("hello");
}
}
class sub extends Super
{
int b=20;
void hi()
{
System.out.println("hi");
}
void bye()
{
System.out.println("bye");
}
}
public class Test{
public static void main(String[] args)
{
Super ob=new sub();
ob.a=20;
ob.hi();
}
}
public static void main(String[] args)
{
super ob=new sub();
ob.a=20;
ob.hi();