• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mock exam question

 
harikumar devandla
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
which of the following statements are correct regarding the code?

<jsp:useBean id="name" class="java.lang.String" />
<%= name %>

1. wont compile
2. It is valid jsp line and it ll print the variable called name
3. It ll compile but produce null as the output
4.It ll work if u create a javabean class with only one variable of type java.lang.String

Can anyone help me with this question.?

Thanks
 
Nitish Bahadur
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am inclined to say none of the above. It will compile and print blank as the output.
 
Mikalai Zaikin
Ranch Hand
Posts: 3371
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, it may be assumed answer 4) - every bean must have unique name in its scope.

regards,
MZ
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic