Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

JWebPlus SCWCD Mock Exam Question

 
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 !!
 
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
 
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 ]
 
There is no beard big enough to make me comfortable enough with my masculinity to wear pink. Tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic