About Question enthuware.jwpv6.2.836 :

Moderator: admin

Post Reply
alayor
Posts: 5
Joined: Sun Jan 05, 2014 6:19 pm
Contact:

About Question enthuware.jwpv6.2.836 :

Post by alayor » Sun Jan 26, 2014 11:09 pm

I think the representation of a null value as a string is an empty string "".
So the answer should be the third option.

admin
Site Admin
Posts: 8627
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.836 :

Post by admin » Mon Jan 27, 2014 5:50 am

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.

DISRUPTOR
Posts: 2
Joined: Mon Feb 10, 2014 2:09 pm
Contact:

Re: About Question enthuware.jwpv6.2.836 :

Post by DISRUPTOR » Fri Feb 14, 2014 5:09 pm

what about with the casting in this instruction?

......" + request.getAttribute("filterParam") ); ?????

admin
Site Admin
Posts: 8627
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.836 :

Post by admin » Fri Feb 14, 2014 8:35 pm

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.

DISRUPTOR
Posts: 2
Joined: Mon Feb 10, 2014 2:09 pm
Contact:

Re: About Question enthuware.jwpv6.2.836 :

Post by DISRUPTOR » Sun Feb 16, 2014 8:26 am

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!

admin
Site Admin
Posts: 8627
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.jwpv6.2.836 :

Post by admin » Sun Feb 16, 2014 8:55 am

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.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests