Consider the following simple example of inheritance, We have created an object of child class - Understanding Constructors : package com.c4learn.inheritance; public class ParentClass { public ParentClass() { System.out.println("Hello Parent"); } public static void main(String[] args) { ChildClass c1 = new ChildClass(); } } class ChildClass extends ParentClass{ public ChildClass() { System.out.println("Hello Child"); } }(...)
The post Super Keyword and Constructors : in Java appeared first on Learn Java Programming.