Click here to Skip to main content
16,014,765 members
Home / Discussions / C#
   

C#

 
GeneralRe: String - ValueType or ReferenceType? Pin
Christian Graus9-Dec-06 23:30
protectorChristian Graus9-Dec-06 23:30 
GeneralRe: String - ValueType or ReferenceType? Pin
Shy Agam9-Dec-06 23:30
Shy Agam9-Dec-06 23:30 
AnswerRe: String - ValueType or ReferenceType? Pin
Robert Rohde9-Dec-06 23:25
Robert Rohde9-Dec-06 23:25 
GeneralRe: String - ValueType or ReferenceType? Pin
Shy Agam9-Dec-06 23:28
Shy Agam9-Dec-06 23:28 
GeneralRe: String - ValueType or ReferenceType? Pin
Christian Graus9-Dec-06 23:49
protectorChristian Graus9-Dec-06 23:49 
GeneralRe: String - ValueType or ReferenceType? Pin
Guffa10-Dec-06 2:21
Guffa10-Dec-06 2:21 
GeneralRe: String - ValueType or ReferenceType? Pin
George L. Jackson12-Dec-06 0:19
George L. Jackson12-Dec-06 0:19 
GeneralRe: String - ValueType or ReferenceType? Pin
Guffa12-Dec-06 15:04
Guffa12-Dec-06 15:04 
George L. Jackson wrote:
When you write code to replace a string "value", since the string "value" is immutable you are actually replacing the current string "object" with a new string "object". The old string "object" is eventually desposed of. However, a value type can be changed without replacing its address space with a new value type address space.


If you consider any changeable value to be mutable, then a string variable is mutable, while the string data that it references is not. In fact that makes all reference types mutable, as you can change the reference.

Also, if all value types are mutable, then there is nothing special with the Point structure, that actually is mutable. The entire debate about mutable structures becomes a moot point if all structures should be considered to be mutable.

I would rather like to make the distinction based on whether the class or structure exposes any methods to change the state of it.

---
It's amazing to see how much work some people will go through just to avoid a little bit of work.

GeneralRe: String - ValueType or ReferenceType? Pin
George L. Jackson12-Dec-06 15:29
George L. Jackson12-Dec-06 15:29 
AnswerRe: String - ValueType or ReferenceType? Pin
Guffa10-Dec-06 2:28
Guffa10-Dec-06 2:28 
AnswerRe: String - ValueType or ReferenceType? Pin
karam chandrabose10-Dec-06 2:23
karam chandrabose10-Dec-06 2:23 
AnswerRe: String - ValueType or ReferenceType? Pin
Daniel Grunwald10-Dec-06 3:32
Daniel Grunwald10-Dec-06 3:32 
QuestionSystem.Data.OracleClient.OracleException was unhandled Pin
Muammar©9-Dec-06 22:10
Muammar©9-Dec-06 22:10 
GeneralRe: System.Data.OracleClient.OracleException was unhandled Pin
George L. Jackson10-Dec-06 1:19
George L. Jackson10-Dec-06 1:19 
GeneralRe: System.Data.OracleClient.OracleException was unhandled Pin
Muammar©10-Dec-06 20:27
Muammar©10-Dec-06 20:27 
GeneralRe: System.Data.OracleClient.OracleException was unhandled Pin
George L. Jackson11-Dec-06 14:56
George L. Jackson11-Dec-06 14:56 
GeneralRe: System.Data.OracleClient.OracleException was unhandled Pin
Muammar©11-Dec-06 18:36
Muammar©11-Dec-06 18:36 
GeneralRe: System.Data.OracleClient.OracleException was unhandled Pin
George L. Jackson12-Dec-06 0:05
George L. Jackson12-Dec-06 0:05 
GeneralRe: System.Data.OracleClient.OracleException was unhandled Pin
Muammar©16-Dec-06 23:00
Muammar©16-Dec-06 23:00 
Questioncrystal report SelectionFormula Error Pin
Robi-Robo9-Dec-06 21:30
Robi-Robo9-Dec-06 21:30 
Questioncrystal report SelectionFormula Error Pin
Robi-Robo9-Dec-06 21:28
Robi-Robo9-Dec-06 21:28 
AnswerRe: crystal report SelectionFormula Error Pin
gnadeem10-Dec-06 4:14
gnadeem10-Dec-06 4:14 
Questionhelp me with the last step in C#.Database Project Pin
kifahhk9-Dec-06 20:59
kifahhk9-Dec-06 20:59 
AnswerRe: help me with the last step in C#.Database Project Pin
Christian Graus9-Dec-06 21:22
protectorChristian Graus9-Dec-06 21:22 
QuestionAdd reference to a .exe assembly? Pin
karam chandrabose9-Dec-06 20:58
karam chandrabose9-Dec-06 20:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.