• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Ans pls

 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Given:
20. public void init(ServletConfig config) throws ServletException {
21. String s1 = config.getInitParameter("servletName");
22. String s2 = config.getServletName();
23. ServletContext context = config.getServletContext();
24. String s3 = context.getInitParameter("serverName");
25. String s4 = context.getInitParameter("servletName");
26. boolean b1 = s1.equals(s2);
27. Boolean b2 = s1.equals(s4);
28. }
...


Which two are true? (Choose two.)

A Compilation will fail due to an error at line 22.
B The value of super.init(config) should be inserted somewhere in this method.
C The value of b1 after line 26 is guaranteed to be true.
D The value of b2 after line 27 is guaranteed to be true.
E Lines 24 and 25 show how to access configuration information useful to an entire web
application
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why dont you compile and run it and you will know the answer in a jiffy
 
muthu moorthy
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you, John, i am doing that now
 
And when my army is complete, I will rule the world! But, for now, I'm going to be happy with this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic