• Post Reply Bookmark Topic Watch Topic
  • New Topic

mock exam question

 
rick collette
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which jsp lines are correct?
1) <%! String myString=�Hello� %>
2) <% String myString=request.getServerName() %>
3) <%= out.print(�Hello�) %>
4) <%= �Hello� %>
I know 30 is wrong, and 4) is correct. Why 1) and 2) are wrong?
 
James Kwan
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rick,
1) and 2) are wrong because the semicolon is missing.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!