How custom class can be converted to common value type?
-
Hi, I am studying for MCTS and there i have a question fro practise purposes. The question is "Create a custom class that can be converted to common value types"? I have been trying to solve this since 1 week but can not get the soluution of it. Can any one help me with this answer... Thanks in advance Thanks
-
Hi, I am studying for MCTS and there i have a question fro practise purposes. The question is "Create a custom class that can be converted to common value types"? I have been trying to solve this since 1 week but can not get the soluution of it. Can any one help me with this answer... Thanks in advance Thanks
Faisal Khatri wrote:
The question is "Create a custom class that can be converted to common value types"?
It sounds like the question is talking about Serialisation. All types, eventually, boil down to some basic types such as int, string, double, bool etc. For example, a Customer type may consist of an account number, a surname, forename, address (another custom type), etc. Account number could just be an int, while surname and forename are strings. Serialisation (and its counterpart deserialisation) is the process of taking complex types and representing them in a common way so that they can be transferred to other systems or persisted to a storage medium. Probably one of the most common ways to serialise stuff is to use XML, which is at its most basic just a big string. Of course you can come up with your own scheme for serialising a type. Now, whether this is what your tutor wants, I don't know. If they are careless with their vocabulary then it probably is. If they are very careful with their word usage then no. In .NET a "value type" has a very specific meaning, and a string (although immutable and therefore often confused with a value type) isn't a value type. Does this help at all? Or does it just raise more questions?
*Developer Day Scotland - Free community conference Delegate Registration Open