Click here to Skip to main content
16,017,502 members
Home / Discussions / C#
   

C#

 
NewsRe: C# error " not all code paths return a value" Pin
javajohn5-Aug-07 5:42
javajohn5-Aug-07 5:42 
Questionmasterpage Pin
TAREQ F ABUZUHRI4-Aug-07 12:23
TAREQ F ABUZUHRI4-Aug-07 12:23 
AnswerRe: masterpage Pin
Paul Conrad4-Aug-07 12:53
professionalPaul Conrad4-Aug-07 12:53 
GeneralRe: masterpage Pin
Paul Conrad4-Aug-07 13:08
professionalPaul Conrad4-Aug-07 13:08 
GeneralRe: masterpage Pin
Malcolm Smart4-Aug-07 13:09
Malcolm Smart4-Aug-07 13:09 
GeneralRe: masterpage Pin
Paul Conrad4-Aug-07 13:15
professionalPaul Conrad4-Aug-07 13:15 
QuestionArraylist mystery Pin
zuidgeest4-Aug-07 9:41
zuidgeest4-Aug-07 9:41 
AnswerRe: Arraylist mystery Pin
Guffa4-Aug-07 13:19
Guffa4-Aug-07 13:19 
That's not a mystery at all. It's a common mistake, and I believe that making it usually gives a better understanding about how objects and references work.

An ArrayList is a list of references.

With statement A you are creating a new array, and you add the reference to that array to the list. Each item in the ArrayList is a reference a separate array.

With statement B you are adding the reference in the subResult variable. As the variable never changes (only the contents of the array that it refers to), you end up with a list of references to the same single array, and that array happens to contain the last values that you put into it.

---
single minded; short sighted; long gone;

GeneralRe: Arraylist mystery Pin
zuidgeest5-Aug-07 5:27
zuidgeest5-Aug-07 5:27 
Questionget page name Pin
TAREQ F ABUZUHRI4-Aug-07 9:27
TAREQ F ABUZUHRI4-Aug-07 9:27 
AnswerRe: get page name Pin
Luc Pattyn4-Aug-07 9:41
sitebuilderLuc Pattyn4-Aug-07 9:41 
GeneralRe: get page name Pin
Urs Enzler4-Aug-07 23:19
Urs Enzler4-Aug-07 23:19 
AnswerRe: get page name Pin
Hessam Jalali4-Aug-07 23:37
Hessam Jalali4-Aug-07 23:37 
GeneralRe: get page name Pin
TAREQ F ABUZUHRI5-Aug-07 4:58
TAREQ F ABUZUHRI5-Aug-07 4:58 
AnswerRe: get page name Pin
Hessam Jalali5-Aug-07 5:33
Hessam Jalali5-Aug-07 5:33 
QuestionHow to submit form? Pin
VahagnSC4-Aug-07 8:43
VahagnSC4-Aug-07 8:43 
AnswerRe: How to submit form? Pin
Hessam Jalali4-Aug-07 21:54
Hessam Jalali4-Aug-07 21:54 
QuestionChanges table in database and transfer to dataset Pin
sgeorgije4-Aug-07 7:20
sgeorgije4-Aug-07 7:20 
AnswerRe: Changes table in database and transfer to dataset Pin
ArunkumarSundaravelu6-Aug-07 5:27
ArunkumarSundaravelu6-Aug-07 5:27 
QuestionCasting type T Pin
User 66584-Aug-07 7:19
User 66584-Aug-07 7:19 
AnswerRe: Casting type T Pin
Scott Dorman4-Aug-07 9:00
professionalScott Dorman4-Aug-07 9:00 
GeneralRe: Casting type T Pin
User 66585-Aug-07 1:37
User 66585-Aug-07 1:37 
GeneralRe: Casting type T Pin
Scott Dorman5-Aug-07 3:43
professionalScott Dorman5-Aug-07 3:43 
AnswerRe: Casting type T Pin
Urs Enzler4-Aug-07 23:23
Urs Enzler4-Aug-07 23:23 
JokeRe: Casting type T Pin
PIEBALDconsult7-Aug-07 12:06
mvePIEBALDconsult7-Aug-07 12:06 

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.