package java_samples_hwang;
/**
*
* @author hwang
*/
class A {
public void sub()
{
System.out.println("Method in Class A");
}
}
class B extends A
{
//@overrided method
public void sub()
{
super.sub();
System.out.println("Method in Class B");
}
}
public class OverrideDemo
{
public static void main(String args[])
{
A aObj = new A();
B bObj = new B();
bObj.sub();
}
}
'백엔드기술 > 개발언어' 카테고리의 다른 글
Parser Demo (0) | 2009.12.09 |
---|---|
Overload Demo (0) | 2009.12.09 |
ConstructorEx (0) | 2009.12.09 |