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 Java Data Structures - Retired Organizing Data Serialization

How does the compiler cast in background?

Hi,

I wonder how the compiler knows how to "translate" a given object (e.g. read by the ObjectInputStream) to a Treet[]-Object (or any other user defined object).

From my point of view the compiler reads the object out of a byte-stream (like FileInputStream) and somehow translates it to an object... but how?

I'd really like to understand the mechanics behind this if that's not an awful big study itself.

Thanks for reading and your answers in advance, Michael

1 Answer

I would recommend reading this JVM Internals blog that goes into detail on how Java works. For your question I would start at the Class File Structure section.

Thanks for the reply! I'll have a look at it asap.