Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
hdhsj sbsnns
415 PointsI dont know when to use the dot between two objects, example: (dispenser.getCharacterName))
i dont understand the syntax when should i use a dot between two object,parentheses i get really confused,can you please help me? i tried to figure it out on my own but with no luck.
1 Answer
Konstantinos Pedarakis
21,301 Pointshi there hdhsj sbsnns
the dot notation isn't used between objects, is it used to call "something" on that object.
most of the times that would be a "method" that does something to the object as for example to change its state or its behaviour.
occasionally can be a variable after the method, but this is considered as a "bad practice", since a variable must be return through a getter, which is again a method.