Solved

Serialization of a Derived Class

Posted on 2013-01-05
6
288 Views
Last Modified: 2013-01-06
When serializing a derived class, the members in its base class are serialized too, correct?
If so, does the base class have to have [Serializable] attribute too?
0
Comment
Question by:metro156
  • 3
  • 3
6 Comments
 
LVL 74

Expert Comment

by:käµfm³d 👽
ID: 38747478
What kind of serialization? Binary? XML?
0
 

Author Comment

by:metro156
ID: 38747507
Binary
0
 
LVL 74

Expert Comment

by:käµfm³d 👽
ID: 38747847
Yes, the base class must be marked as Serializable as well.
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

Author Comment

by:metro156
ID: 38748297
So are you saying if base class is not Serialized, program will not compile or runtime error?

Or  Are you saying --if you only Serialize the derived class, the data declared only within the derived class be serialized?
0
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 300 total points
ID: 38748580
If you serialize the derived class, you will get an exception stating that the base class needs the attribute as well:

Screenshot
0
 

Author Closing Comment

by:metro156
ID: 38749099
Thank you
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now