This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes JSP and the fly likes [ ] vs . Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "[ ] vs ." Watch "[ ] vs ." New topic

[ ] vs .

Nicholas Carrier
Ranch Hand

Joined: Apr 14, 2005
Posts: 78
This is probably really simple, but I'm reading Head First: Servlet's and JSP and I understand how this works.


Where there is an attribute of type person that has a property that is an object of type Dog that has a property that is a string which holds his name. In that case it's going to print out the person's dog's name.

What confuses me, and it's really just a side question, is how to do that with [].

This obviously doesn't work because it goes from inner most expression outwards.


And prints out nothing because there is no property in the person object that has the same name as say Clifford.

Thanks for you help ahead of time. If I figure it out before anyone replies I'll post my own answer.

Teaching yourself anything is always the cheapest way, but it definitely takes a lot of time and effort.<br /> <br />Thank you javaranch <a href="http://""" target="_blank" rel="nofollow">Learn How to Ask Your Question</a> and be nice
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63870

are all equivalent.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: [ ] vs .
jQuery in Action, 3rd edition