Subclass Java: Write a Program to Explain Subclass In Java With Example?
package com.java.Softwaretestingblog; class superclass { public void show() { System.out.println("Parent Class"); } } public class SubclassExample extends superclass{ SubclassExample() { super.show(); } public static void main(String[] args) { // TODO Auto-generated method stub SubclassExample obj=new SubclassExample(); } }
Check Also: Remove Unnecessary Spaces Using Trim()
Output:
Parent Class
Leave a Reply