Monday, April 23, 2018

Can a class inherit from multiple abstract class ?

  1. public class MyAbstractExe2 extends MyAbstractExe1, MyAbstractExe3
  2. {
  3. @Override
  4. void run() {
  5. System.out.println("run");
  6. }
  7. }

  8. abstract class MyAbstractExe3 {
  9. abstract void run();
  10. void test() {
  11. System.out.println("test of MyAbstractExe3 !!");
  12. }
  13. }

  14. abstract class MyAbstractExe1 {
  15. abstract void run();
  16. void test() {
  17. System.out.println("test of MyAbstractExe1 !!");
  18. }
  19. }
No ! we can not inherit a class from multiple abstract class. Syntax error by compiler at line 1

No comments:

Post a Comment

How to run standalone mock server on local laptop

 Please download the standalone wiremock server from Direct download section at the bottom of the page.  Download and installation Feel fre...