Page 1 of 1

About Question enthuware.ocpjp.v17.2.3706 :

Posted: Tue Jan 02, 2024 10:56 am
by Badem48
Hi,

I think this is a good question, but I am curious: Do we need to memorize which I/O Stream class method throws which exception?

Re: About Question enthuware.ocpjp.v17.2.3706 :

Posted: Fri Jan 05, 2024 3:21 am
by admin
Not for all classes but for serialization, yes, you need to know that it may throw a ClassCastException. This is actually quite relevant to deserialization. ClassCastException needs to be handled separately because it doesn't extend IOException.