r/javahelp • • Feb 07 '21

Unsolved Serialisation Java8

Yesterday i took an interview where i was asked "why serialisation is said to b lazy" ?

I certainly could not answer this as i have never ever come across anything where the serialisation is considered lazy. After the interview i did a quick google and yet no ans.

Can anyone please help know the right ans for this with detailed explanation

java8

22 Upvotes

21 comments sorted by

View all comments

3

u/Chris_TMH Feb 07 '21

Maybe something to do with lazy loading? Where data is only fetched when needed. I guess with serialization, not all objects in memory are somehow already serialized - they are only serialized when being sent/received.

1

u/Jyotikb25 Feb 07 '21

Thanks, this makes sense. So can i consider this same meaning of lazy in for Springboot @lazy annotation which is used to avoid circular dependency.

1

u/Chris_TMH Feb 07 '21

Maybe? Just my guess. Were you able to ask for clarification?

1

u/Jyotikb25 Feb 07 '21

I tried asking in the end of interview but all in vain.