Overloading Methods : Overloading Methods « JSP « Java






Overloading Methods


<HTML>
    <HEAD>
        <TITLE>Overloading Methods</TITLE>
    </HEAD>

    <BODY>
        <H1>Overloading Methods</H1>

        <%!
            javax.servlet.jsp.JspWriter localOut;

            void printText() throws java.io.IOException
            {
                localOut.println("Hello!<BR>");
            }

            void printText(String s) throws java.io.IOException
            {
                localOut.println(s + "<BR>");
            }
        %>     
        <%
        localOut = out;     

        printText();
        printText("Hello from JSP!");
        %>
    </BODY>
</HTML>
           
       








Related examples in the same category

1.Overriding Methods 2