• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Question 43)

 
Ranch Hand
Posts: 157
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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” %>
author's answer is only 4) . do you think so?
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1)<%! String myString=”Hello” %>
It needs to have a ; at the end like this
<%! String myString=”Hello”; %>
2) <% String myString=request.getServerName() %>
Same as above the ; is missing
3) <%= out.print(“Hello” %>
<%= means out.print so esssentially
it would be
out.print(out.print("Hello"));
which is not the way how it should be...
4) <%= “Hello” %>
This is the correct one as given by the author.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic