class Test
{
static void m1()
{
System.out.println(" super class Test m1() ");
}
}
class Demo extends Test
{
static void m1()
{
System.out.println(" sub class Demo m1() ");
}
public static void main( String args[] )
{
Test t = new Demo(); // UpCasting
t.m1();
m1();
}
}
Output: