Which is better: “serialize and then encrypt” or “encrypt and then serialize”? Let say in a simple Java program, Considering all the facts, like security and performance, Which is the best way to follow. I tried searching for a answer but proper answer is not out there.

Which is better: “serialize and then encrypt” or “encrypt and then serialize”?
If you serialize it, then you have one [likely binary] block of data that you would then need to encrypt.

If you encrypt the contents first (however you might achieve this) and then serialize it, it would presumably have to identify the things that are encrypted, and this could likely leak information about the object or its makeup.  Also, this would theoretically open the individual parts up to tampering, or replacement, or other specific attack.

Therefore, I assume the best answer is to serialize and then encrypt.