I think the representation of a null value as a string is an empty string "".
So the answer should be the third option.
About Question enthuware.jwpv6.2.836 :
Moderator: admin
-
- Posts: 5
- Joined: Sun Jan 05, 2014 6:19 pm
- Contact:
-
- Site Admin
- Posts: 10043
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.jwpv6.2.836 :
You are probably referring to EL. In this case, however, a simple java + operation is performed on a String and a null reference (request.getAttribute("filterParam") is returning null here). So null will be printed.
If you like our products and services, please help us by posting your review here.
-
- Posts: 2
- Joined: Mon Feb 10, 2014 2:09 pm
- Contact:
Re: About Question enthuware.jwpv6.2.836 :
what about with the casting in this instruction?
......" + request.getAttribute("filterParam") ); ?????
......" + request.getAttribute("filterParam") ); ?????
-
- Site Admin
- Posts: 10043
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.jwpv6.2.836 :
I am not sure what you mean. I don't see any cast anywhere.
If you like our products and services, please help us by posting your review here.
-
- Posts: 2
- Joined: Mon Feb 10, 2014 2:09 pm
- Contact:
Re: About Question enthuware.jwpv6.2.836 :
sorry for my poor English.
my question is:
Is not necessary to make a casting before this instruction?
//code for doGet of DestinationServlet
...
System.out.println("Param Added by SimpleFilter : " [...(String) casting here...]+ request.getAttribute("filterParam") ); }
Would not it be a compilation error?
Thank you!
my question is:
Is not necessary to make a casting before this instruction?
//code for doGet of DestinationServlet
...
System.out.println("Param Added by SimpleFilter : " [...(String) casting here...]+ request.getAttribute("filterParam") ); }
Would not it be a compilation error?
Thank you!
-
- Site Admin
- Posts: 10043
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.jwpv6.2.836 :
No, the cast is not needed. Why do you think a cast is required? I am asking because you might be missing a fundamental concept which is already covered in OCAJP/OCPJP.
HTH,
Paul.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 24 guests