-5

I want to use a method from a child class in the method of a parent class, is it possible?

class Parent{
    public Parent() {   }

    public void methodParent () { 
        methodChild();       
    }
}

class Child extends Parent {    
    public Child() {
        super();
    }

    public void methodChild() {
        //do somthing
    }

}
Stefan
  • 2,395
  • 4
  • 15
  • 32
sunny
  • 253
  • 1
  • 5
  • 15

1 Answers1

-1

the class parent will can not find the method methodChild(),it doesn't exist when you bulid instance of classs parent