How to access subclass in java? please tell me the syntex with an example.
class SuperClass{ public void hello(){ System.out.println("Hello World"); } } class SubClass extends SuperClass{ public void hello(){ super.hello(); System.out.println("Welcome"); } } class SubClassExample{ public static void main(String[] args) { SubClass c=new SubClass(); c.hello(); } }
Ads