Hi:
Here is the piece of code:
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
private boolean lineBreak = true;
response.setContentType(“text/html”);
PrintWriter out = response.getWriter();
out
.println(“<!DOCTYPE HTML PUBLIC \”-//W3C//DTD HTML 4.01 Transitional//EN\”>”);
out.println(“<HTML>”);
out.println(” <HEAD><TITLE>A Servlet</TITLE></HEAD>”);
out.println(” <BODY>”);
out.print(” This is “);
out.print(new java.util.Date());
out.println(“, using the GET method along with new text”);
display(request, response);
out.println(” </BODY>”);
out.println(“</HTML>”);
out.flush();
out.close();
}
In the above code where it says “private boolean lineBreak = true;”, i get an error in myeclipse stating that “illegal parameter for lineBeak; only final is permitted”
I would like to know why it says only final is permitted; can’t i use a non-final variable in doGet() method?
Thanks in advance!!!
Bhavin