Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP Element mixture

 
Deepan Devadasan
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is Question I encountered during exam preparation...

The answer was given as Compile time error

<%@page language="java" %>
<%!
Vector store;
%>
<%
Enumeration en=store.elements();
While(en.hasMoreElements())
{
out.println(en.nextElement());
}
%>
<%!
Public void jspInit()
{
store=new Vector();
store.addElement("First Value");
store.addElement("Second Value");
}
%>


Can some clarify the reasoning behind the answer
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64700
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While

Public
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic