Calling Superclass Constructors : Exception « JSP « Java






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>

           
       








Related examples in the same category

1.Catching an ArrayIndexOutOfBoundsException Exception
2.Causing a Runtime Error
3.Creating a Custom Exception Object
4.Runtime Polymorphism