Java-Creating Subclasses

Creating Subclasses It is also possible to subclass a class that has been imported from another package. This is illustrated by following program. Note that the Data class inside the mypack package. Program Package Source package mypack; public class Data { public int data1 = 20; public void printData() { System.out.println(“data1 = “+data1); } } … Read more…