Social Icons

Wednesday 4 September 2013

Function overriding In java

class A
{


void show()
{
System.out.println("\n it is of a class");
}

}


class B extends A
{
void show()
{
super.show();
System.out.println("\n it is of B class");
}


}




class C extends B
{
void show()
{
super.show();
System.out.println("\n it is of C class");
}

}

class over
{
public static void main(String args[])
{
C c=new C();
c.show();
}
}

No comments:

Post a Comment

 

Sample Text

Sample text

 
Just Programming Cse DriveReputation Management