JSP Java


    
        Working With Constructors and Inheritance
    
    
        

Working With Constructors and Inheritance


        <%!
            javax.servlet.jsp.JspWriter localOut;
            
            class a
            {
                a() throws java.io.IOException 
                {
                    localOut.println("In a\'s constructor...
");
                }
                a(String s)  throws java.io.IOException
                {
                    localOut.println("In a\'s String constructor...
");
                    localOut.println(s);
                }
            }
            
            class b extends a  
            {
                b(String s) throws java.io.IOException 
                {
                    super(s);
                    localOut.println("In b\'s String constructor...
");
                    localOut.println(s);
                }
            }
        %>     
        <%
            localOut = out;     
            b obj = new b("Hello from JSP!
");
        %>