Skip to main content
1 of 2
Akshay Gaikwad
  • 460
  • 1
  • 6
  • 13

Calling contructor from another constructor

class MyConstructorDemo extends ConstructorDemo { MyConstructorDemo() { this("calling another constructor"); } MyConstructorDemo(String arg) { System.out.print("This is passed String by another constructor :"+arg); } } 

Also you can call parent constructor by using super() call

Akshay Gaikwad
  • 460
  • 1
  • 6
  • 13