The following code is my "java practice" versions of the Dog and Collar classes taken from the book "SCJP Sun Certified Programmer for Java 6 Study Guide (Exam 310-065)" Chapter 6 Certification Objectives—Serialization (Exam Objective 3.3).
I expected the code to produce a runtime exception because the Collar class did not implement Serializable, but the code compiles and runs producing the following output.
Collar@578ceb
5
yes
Question 1. Why didn't I get an exception?
Question 2. What exactly does the output Collar@578ceb represent?