Quantcast
Channel: Learn Java Programming
Viewing all articles
Browse latest Browse all 39

Super Keyword and Constructors : in Java

$
0
0

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.


Viewing all articles
Browse latest Browse all 39

Trending Articles