Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 189
  • Last Modified:

Easy Question - Which one of these is invalid?!?

In a JSP, which of these would be invalid?

1. String value = request.getAttribute("value");
2. request.setAttribute("value", value);
3. String value = request.getParameter("value");
4. Object value = request.getAttribute("value");

I think it is 4 since the object type of "value" will probably be a type that is not of "Object" type...But then isn't a type like "String" an "Object" so then 4 would be valid...Ok, now i am not sure again.  Can someone tell me which is the invalid one and why?

Thanks
0
aniston
Asked:
aniston
1 Solution
 
objectsCommented:
1. because getAttribute returns an Object
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now