SCJP 6
Banashri Mandal wrote:Thanks. But what about the first scenario, then ? If I comment out both Line 1 and Line 2, does not the code write anything to the file ?
The code gives expected output.
SCJP 6
SCJP 6
Punit Singh wrote:That is very advance concept Treimin, I only know private method writeObject() is called internally by
ObjectOutputStream.writeObject(Object) method. It must be using reflection inside and must be checking for private access of these methods.
SCJP 6
Punit Singh wrote:See this link's 1st and 2nd reply to get some idea about power of reflection.
SCJP 6
Punit Singh wrote:Why we have to read, it is not in the scjp course :roll: