Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Mock Exam Question

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I was going through one of the mock tests and I came across this question.

Given the following jsp line select the correct statements:
<% public void jspInit() { ...java code...} %>

1) It is a valid line that can be used to initialize the servlet that implements the jsp file.
2) It won't compile as no identifer can start with jsp not _jsp.
3) It will serve as the servlet initialization if the function's name is _jspInit.
4) There is no way to initialize a jsp's implementation class servlet.

When I checked the answers it says that option 1 is correct.

But the jspInit() method is defined in a scriptlet and not in a declaration.
Is there a printing mistake?Should it be <%! instead of <%.

Any comments....

Thanks
Rakesh.
 
Ranch Hand
Posts: 310
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's must be a printing mistake
 
rakesh gaddam
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
Rakesh.
 
    Bookmark Topic Watch Topic
  • New Topic