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

Java Inheritance in Java Inheritance in Java Everything Inherits from Object

I'm still unsure about what casting does :/

also what does "Object object : list" mean again?

1 Answer

Steven Parker
Steven Parker
231,236 Points

Casting is just "playing pretend" with the compiler. It's like you are telling the compiler: "let's pretend that this thing is a (your casting type here) instead of what it really is". One use of it is to allow you to access properties that are not part of the declared class, as illustrated in the other questions of this quiz.

And "Object object : list" means that within the loop, each item of the "list" will be aassigned to an Object named "object", one at a time.