0

This & Super keyword

class Parent { void m1() { System.out.println("parent m1 method"); } } class Child extends Parent { void m1() { System.out.println("child m1 method"); } void m2() { this.m1(); super.m1(); } public static void main (String []args) { new Child().m2(); } }

30th Apr 2019, 2:35 PM
Harinath Rajesh
Harinath Rajesh - avatar
3 Antworten
+ 2
Your parent class is not closed. Add } before your child class starts.
30th Apr 2019, 2:54 PM
Denise Roßberg
Denise Roßberg - avatar
+ 2
Harinath Rajesh Your welcome :)
30th Apr 2019, 3:16 PM
Denise Roßberg
Denise Roßberg - avatar
+ 1
Thanks bro
30th Apr 2019, 3:09 PM
Harinath Rajesh
Harinath Rajesh - avatar