Java Inheritance - calling superclass method

前端 未结 5 1260
遥遥无期
遥遥无期 2020-11-27 18:15

Lets suppose I have the following two classes

public class alpha {

    public alpha(){
        //some logic
    }

    public void alphaMethod1(){
        /         


        
5条回答
  •  青春惊慌失措
    2020-11-27 18:55

    You can do:

    super.alphaMethod1();
    

    Note, that super is a reference to the parent, but super() is it's constructor.

提交回复
热议问题