Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JWebPlus SCWCD Mock Exam Question

 
jr gil
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • 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 !!
 
Andres Bonifacio
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • 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
 
Amer Khan
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic