Subscribe

RSS Feed (xml)

Powered By

Skin Design:
Free Blogger Skins

Powered by Blogger

Sunday, December 2, 2007

java code for Working With Constructors and Inheritance



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!
");
%>

No comments: