M
Marc
I am studying something and a question in a book talks about value class.
What should be that? I trying to figure it out, but google gives too many
non relevant answers and sentences containing these two words. If somebody
would know this by hearth it would be a help. I thought struct is a value
type and class is a reference type, so neither a 'reference struct' nor a
'value class' would exists.
It's just a silly question in a book:
You need to create a simple class or structure that contains only value
types. You must create the class or structure so that it runs as efficiently
as possible. You must be able to pass the class or structure to a procedure
without concern that the procedure will modify it. Which of the following
should you create?
A reference class
B reference structure
C value class
D value structure
Correct Answer: D
A Incorrect: You could create a reference class; however, it could be
modified when passed to a procedure.
B Incorrect: You cannot create a reference structure.
C Incorrect: You could create a value class; however, structures tend to be
more efficient.
D Correct: Value structures are typically the most efficient.
I understand C is the correct anwer, but what would 'reference structure'
but also 'value class' be? Well they confirm that reference structure is non
existant nonsence, but the term value class seems to be something. Huh?
I am starting to think the book just has an error in it.![Smile :-) :-)](/styles/default/custom/smilies/smile.gif)
What should be that? I trying to figure it out, but google gives too many
non relevant answers and sentences containing these two words. If somebody
would know this by hearth it would be a help. I thought struct is a value
type and class is a reference type, so neither a 'reference struct' nor a
'value class' would exists.
It's just a silly question in a book:
You need to create a simple class or structure that contains only value
types. You must create the class or structure so that it runs as efficiently
as possible. You must be able to pass the class or structure to a procedure
without concern that the procedure will modify it. Which of the following
should you create?
A reference class
B reference structure
C value class
D value structure
Correct Answer: D
A Incorrect: You could create a reference class; however, it could be
modified when passed to a procedure.
B Incorrect: You cannot create a reference structure.
C Incorrect: You could create a value class; however, structures tend to be
more efficient.
D Correct: Value structures are typically the most efficient.
I understand C is the correct anwer, but what would 'reference structure'
but also 'value class' be? Well they confirm that reference structure is non
existant nonsence, but the term value class seems to be something. Huh?
I am starting to think the book just has an error in it.
![Smile :-) :-)](/styles/default/custom/smilies/smile.gif)