my dog learned polymorphism
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Cobins Exam Very complectaed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Cobins Exam Very complectaed " Watch "Cobins Exam Very complectaed " New topic

Cobins Exam Very complectaed

Ranch Hand

Joined: Nov 22, 2001
Posts: 110
Question 4)
Given the following jsp line select the correct statements:
<% public void jspInit() { 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
why i think it won't compile as everything goes into service as they entered in Scriplets....

Muhammad Hussain<br />Sun Certified Java Programer (SCJP2)<br />Sun Certified Web Component Devloper SCWCD
Peter den Haan
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Yes, 1) would be right if the method were defined as <%! public void jspInit() ... %>. Note exclamation mark.
- Peter
[ March 06, 2002: Message edited by: Peter den Haan ]
I agree. Here's the link:
subject: Cobins Exam Very complectaed
It's not a secret anymore!