Solved programming problem

Shape and Circle.

Source code

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!");

    }

   

}
Join the discussion

Add your comment