Saturday, 17 December 2011

JSP Examples Tutorial - Calling Superclass Constructors


<HTML>
    <HEAD>
        <TITLE>Calling Superclass Constructors</TITLE>
    </HEAD>
    <BODY>
        <H1>Calling Superclass Constructors</H1>
        <%!
            javax.servlet.jsp.JspWriter localOut;
            class a
            {
                a() throws java.io.IOException 
                {
                    localOut.println("In a\"s constructor...<BR>");
                }
            }
            class b extends a
            {
                b() throws java.io.IOException 
                {
                    localOut.println("In b\"s constructor...<BR>");
                }
            }
        %>     
        <%
        localOut = out;     
        b obj = new b();
        %>
    </BODY>
</HTML>

No comments:

Post a Comment