File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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: 63838

are all equivalent.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: [ ] vs .
It's not a secret anymore!