JSP: Comment utiliser les méthodes surchargé en jsp.

Author:
       

    
        Overriding Methods
    

    
        

Overriding Methods

        <%!             javax.servlet.jsp.JspWriter localOut;             class animal             {                 public void breathe()  throws java.io.IOException                  {                     localOut.println("Breathing...
");                 }             }             class trout extends animal             {                 public void breathe()  throws java.io.IOException                  {                     localOut.println("Gilling...
");                 }             }         %>              <%             localOut = out;                  out.println("Creating an animal object...
");             animal a = new animal();             a.breathe();             out.println();             out.println("Creating a trout object...
");             trout t = new trout();             t.breathe();         %>                         

Leave a Reply

Your email address will not be published. Required fields are marked *