In 2 java classes , If class A implements Serializable and class B extends A, then by default is Class B Serializable also? From what I understand, it is.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes. This follows from the concept of inheritance in Java. Since A is serializable and B extends A, B is serializalbe. Worth noting, notice that B is not “Default” Serializable, there is no choice as long as B extends A.