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/ankit_jajajaja Feb 07 '21

Hey guys i am mostly confused with this word Lazy. I hear it many times like lazy initialisation. What does it means ?

5

u/tiedor Feb 07 '21

Don't know what is the meaning in OP's question. But generally speaking, is lazy when it's done only when needed. It's the opposite of eager, meaning it's done as soon as possible, even if you will end up with not needing it.

3

u/marvk Feb 07 '21

In this context, it has no secret meaning. It literally means either one or even both of

Unwilling to do work or make an effort; disinclined to exertion.

Showing a lack of effort or care.

-2

u/nutrecht Lead Software Engineer / EU / 20+ YXP Feb 07 '21

That's just plain wrong. "Lazy initialization" has nothing to do with what you're describing. /u/tiedor is correct.

3

u/marvk Feb 07 '21

I said "in this context" as in "in the context of the original question".

3

u/Mimehunter Feb 07 '21

The original may have actually meant ' when needed' - the interviewer could have been trying to see what level of knowledge the applicant had of the terminology.

Then again, you could be right.

Then again (as an interviewer) sometimes you leave it open ended just to get them to talk.

But only ops interviewer could say for certain