• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Eduardo Cobian Mock exam doubt

 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question 4 from Eduardo Cobian

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.

Answer 1.
How can this be a valid line its a scriplet and not a declaration ?
 
Deepak Jain
Ranch Hand
Posts: 637
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any suggestions ?
 
gurneeraj singh
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
According to me, you are right this is not a valid line, it should be a declaration.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by gurneeraj singh:
According to me, you are right this is not a valid line, it should be a declaration.


yes...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic