JSP Java Tutorial

< HTML>
    
        Overloading Methods
    
    
        

Overloading Methods


        <%!
            javax.servlet.jsp.JspWriter localOut;
            void printText() throws java.io.IOException
            {
                localOut.println("Hello!
");
            }
            void printText(String s) throws java.io.IOException
            {
                localOut.println(s + "
");
            }
        %>     
        <%
        localOut = out;     
        printText();
        printText("Hello from JSP!");
        %>