• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

wrapper class

 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

When you subclass a wrapper class, you must override at least one of the wrapper class's methods.


I think this statement is false. Kindly correct me if I am wrong.
 
Sravan Kumar
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you mean the wrapper classes in J2SE like Integer, Long et al, yes, the statement is wrong! They are final. Subclassing them is not possible.
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this one is regarding javax.servlet package wrapper classes.
Not the wrapper classes in Java SE ==>
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe you could be a little more clear with your question. I'm not sure which wrapper classes you're referring to.

There is this though:
http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServlet.html
A subclass of HttpServlet must override at least one method, usually one of these... etc.
 
Vishnu Prakash
Ranch Hand
Posts: 1026
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the below statement true about servlet Wrapper Classes?

is the question. And this


When you subclass a wrapper class, you must override at least one of the wrapper class's methods.


is the given answer.

Now kindly tell me whether this option is correct.
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by vishnu prakash:
Is the below statement true about servlet Wrapper Classes?

is the question. And this



is the given answer.

Now kindly tell me whether this option is correct.


Are you talking wrapper class like HttpServletRequestWrapper ?

http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpServletRequestWrapper.html

The class is not abstract so there is no need to implement/overide any methods.
 
Vishnu Prakash
Ranch Hand
Posts: 1026
 
SunilRee Gupta
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes You are right if you are talking with respect to javax.servlet.* Package. WE are having 4 Wrappers class.Generally used when you want to give your own implemetation for HttpServletRequest or HttpServletResponse methods.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic