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(); } }
3 Antworten
+ 2
Your parent class is not closed.
Add } before your child class starts.
+ 2
Harinath Rajesh Your welcome :)
+ 1
Thanks bro