Working With Constructors and Inheritance : Class in JSP Page « JSP « Java Tutorial

        <TITLE>Working With Constructors and Inheritance</TITLE>

        <H1>Working With Constructors and Inheritance</H1>
            javax.servlet.jsp.JspWriter localOut;
            class BaseClass
                BaseClass() throws 
                    localOut.println("In a\'s constructor...<BR>");
                BaseClass(String s)  throws
                    localOut.println("In a\'s String constructor...<BR>");
            class DerivedClass extends BaseClass  
                DerivedClass(String s) throws 
                    localOut.println("In b\'s String constructor...<BR>");
            localOut = out;     

            DerivedClass obj = new DerivedClass("Hello from JSP!<BR>");

23.14.Class in JSP Page
23.14.1.Using Inheritance
23.14.2.Using Restricted Access
23.14.3.Calling Superclass Constructors
23.14.4.Using Parameterized Constructors
23.14.5.Working With Constructors and Inheritance
23.14.6.Overloading Methods
23.14.7.Overriding Methods in derived class
23.14.8.Using Superclass Variables With Subclassed Objects
23.14.9.Runtime Polymorphism
23.14.10.Using Abstract Classes
23.14.11.Creating a Java Interface