Shape Class:
package pkg5;
public class Shape
{
private void draw()
{
System.out.println("Drawing Shape");
}
}
Circle Class:
package pkg5;
public class Circle extends Shape
{
///this is not a Override method becasue parent method is private,that method can't be override in child method
public void draw()
{
System.out.println("Drawing Circle!");
}
}
Add your comment