Abstract

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

<HTML> <HEAD> <TITLE>Using Abstract Classes</TITLE> </HEAD> <BODY> <H1>Using Abstract Classes</H1> <%! javax.servlet.jsp.

JspWriter localOut; abstract class a { abstract String getText() throws java.io. IOException; public void printem() throws java.io.IOEx ception { localOut.println(getText()); } } class b extends a { String getText() throws java.io.IOExcepti on { return "Hello from JSP!"; } } %> <% localOut = out; b bObject = new b();

bObject.printem(); %> </BODY> </HTML>

You might also like