• 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

JWebPlus SCWCD Mock Exam Question

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question ID: 996171458475
Which of the following classes provide methods to write messages to a log file ?
2 correct answers.
1.) GenericServlet
2.) HttpServletRequest
3.) ServletContext
4.) Only GenericServlet
I marked 1 and 4. It said I was wrong. Correct answer 1 and 3.
Isn't ServletContext an <<interface>> like HttpServletRequest is an interface, not a CLASS !!
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
An interface is a lot like an abstract class. I guess you have been so strict in interpreting the question
 
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1.) GenericServlet
3.) ServletContext
3--is correct.
ServletContext interface is implemented by the container,this means that there is a class(container class)which implements all the methods defined in the ServletContext interface.
including 'log' methods.
1-- is also correct, GS class only implements the log methods of SC not the interface.
To clear it a bit further,just think how we are able to use other methods defined in ServletContext interface (i.e getRealPath,getContext,getResource)
answer is the container implements SC(container class).
'no worries'
Amer
[ May 26, 2003: Message edited by: Amer Khan ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic