简体   繁体   中英

Java- How to call Super Implementation method in subclass?

How can i call super implementation in child class, if same method is overriden in Child class ??

`

// This interface is in different File

public Interface ParentClass {
ResponseEntity<byte[]> getName(firstName, LastName)  // How can i use this interface defined under getAllData     
}

// This method is in different File

public class ChildClass implements ParentClass {
public getAllData(fName, lName) { 
 ResponseEntity<byte[]> hObject = getName(fName, lName);    // this is calling below Overridden method. How to call super Implementation Interface here.
}

@Override
public getName(fName, lName) {  // This is getting called everytime during service call
    throw new Exception();
  }
}
// Before writing this Override method i was able to access Parent Interface

`

I can't remove Override method also.. Please help me. Many Thanks in advance

// This method is in different File

public class ChildClass implements ParentClass {
public getAllData(fName, lName) { 
 return super.getName(fName, lName);    
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM