| Author |
EL code magnet question from CH 8 HFSJ
|
meera kanekal
Ranch Hand
Joined: Feb 13, 2005
Posts: 75
|
|
Hi,
I am studying thru CH 8 from HFSJ and had a question regarding the Code Magnet Answers from page 382. The authors mention about the "Bonus exercise: write the EL expressions a little differently (forget the magnets), but print the same result". The exercise is for composing the EL for the output:
Leelu's dog Clyde's toys are: stick, neighbor's cat, and a Barbie doll head.
I am wondering if any of you have an answer to that?
Will be much obliged.
Thanks,
Meera
|
 |
Vijitha Kumara
Bartender
Joined: Mar 24, 2008
Posts: 3673
|
|
|
Please give more details, what is the source we can use to construct this EL ?
|
SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
|
 |
Ankit Garg
Saloon Keeper
Joined: Aug 03, 2008
Posts: 9191
|
|
That exercise is for you to try. If we provide you a solution, how will you learn. Remember that you can use whatever EL you want.
Hint: try to use [] instead of . or something of that sort to experiment...
|
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
|
 |
meera kanekal
Ranch Hand
Joined: Feb 13, 2005
Posts: 75
|
|
The reason I asked was because I was not able to totally get it. I thought this was a friendly forum where you could ask questions if you could not figure it out.
Meera
|
 |
Vijitha Kumara
Bartender
Joined: Mar 24, 2008
Posts: 3673
|
|
meera kanekal wrote:The reason I asked was because I was not able to totally get it. I thought this was a friendly forum where you could ask questions if you could not figure it out.
Yes, this is really friendly (perhaps the most ) forum. But you haven't provided enough information for us to give you a clue to solve your issue (not everybody have the book with them when they answer the posts).
|
 |
Ankit Garg
Saloon Keeper
Joined: Aug 03, 2008
Posts: 9191
|
|
meera kanekal wrote:The reason I asked was because I was not able to totally get it. I thought this was a friendly forum where you could ask questions if you could not figure it out.
I think you misunderstood me. I didn't mean to say that we'll not provide you the solution. What I was trying to say was that the question doesn't have a specific solution. You are free to explore EL and try to get the same output using EL. There can be multiple ways of solving that problem. Let me try to give you an example. The code magnets in the answer are (I've separated magnets with | symbol)
I can also write the EL as
or
There can be many more solutions like this...
|
 |
meera kanekal
Ranch Hand
Joined: Feb 13, 2005
Posts: 75
|
|
Thank you Ankit for your input.
Regards,
Meera
|
 |
 |
|
|
subject: EL code magnet question from CH 8 HFSJ
|
|
|