Click here to Skip to main content
15,902,492 members
Home / Discussions / C#
   

C#

 
AnswerRe: Delegates Pin
leppie19-Oct-07 4:55
leppie19-Oct-07 4:55 
QuestionShould we use 'ref' keyword while passing objects also... Pin
Spunky Coder19-Oct-07 0:04
Spunky Coder19-Oct-07 0:04 
AnswerRe: Should we use 'ref' keyword while passing objects also... Pin
DavidNohejl19-Oct-07 0:33
DavidNohejl19-Oct-07 0:33 
GeneralRe: Should we use 'ref' keyword while passing objects also... Pin
Spunky Coder19-Oct-07 0:46
Spunky Coder19-Oct-07 0:46 
GeneralRe: Should we use 'ref' keyword while passing objects also... Pin
DavidNohejl19-Oct-07 1:00
DavidNohejl19-Oct-07 1:00 
GeneralRe: Should we use 'ref' keyword while passing objects also... Pin
Spunky Coder19-Oct-07 1:04
Spunky Coder19-Oct-07 1:04 
GeneralRe: Should we use 'ref' keyword while passing objects also... Pin
DavidNohejl19-Oct-07 1:32
DavidNohejl19-Oct-07 1:32 
AnswerRe: Should we use 'ref' keyword while passing objects also... Pin
Stefan Troschuetz19-Oct-07 0:38
Stefan Troschuetz19-Oct-07 0:38 
Spunky Coder wrote:
The above still gives the output as "Grade1Employee" why is it so?


You're passing a reference to a Manager object to the method. If you change the object via this reference the changes reflect outside the method (first example). If you create a new object and assign the reference to it to the method parameter, then this change does not reflect outside the method (second example), because changes to parameters (values or references) do not reflect outside a method unless you use the ref or out keyword.


"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook

www.troschuetz.de

AnswerRe: Should we use 'ref' keyword while passing objects also... Pin
laserbaronen19-Oct-07 0:41
laserbaronen19-Oct-07 0:41 
AnswerRe: Should we use 'ref' keyword while passing objects also... Pin
Spunky Coder19-Oct-07 1:01
Spunky Coder19-Oct-07 1:01 
Questionset CurrentRow in a DataGridView Pin
jmaalouly18-Oct-07 23:29
jmaalouly18-Oct-07 23:29 
AnswerRe: set CurrentRow in a DataGridView Pin
leppie19-Oct-07 5:05
leppie19-Oct-07 5:05 
QuestionToolStripMenuItems from SQL Pin
hobbsieoz18-Oct-07 23:18
hobbsieoz18-Oct-07 23:18 
AnswerRe: ToolStripMenuItems from SQL Pin
Jacky Yiu19-Oct-07 0:00
Jacky Yiu19-Oct-07 0:00 
GeneralRe: ToolStripMenuItems from SQL Pin
hobbsieoz19-Oct-07 0:02
hobbsieoz19-Oct-07 0:02 
AnswerRe: ToolStripMenuItems from SQL Pin
Jacky Yiu23-Oct-07 16:34
Jacky Yiu23-Oct-07 16:34 
QuestionC# 64-bit DLL? Pin
George_George18-Oct-07 23:15
George_George18-Oct-07 23:15 
AnswerRe: C# 64-bit DLL? Pin
martin_hughes19-Oct-07 0:14
martin_hughes19-Oct-07 0:14 
Questionnextline Pin
zeeShan anSari18-Oct-07 23:00
zeeShan anSari18-Oct-07 23:00 
AnswerRe: nextline Pin
Eduard Keilholz18-Oct-07 23:05
Eduard Keilholz18-Oct-07 23:05 
AnswerRe: nextline Pin
Guffa18-Oct-07 23:09
Guffa18-Oct-07 23:09 
GeneralRe: nextline Pin
zeeShan anSari18-Oct-07 23:15
zeeShan anSari18-Oct-07 23:15 
GeneralRe: nextline Pin
zeeShan anSari18-Oct-07 23:18
zeeShan anSari18-Oct-07 23:18 
GeneralRe: nextline Pin
Colin Angus Mackay18-Oct-07 23:24
Colin Angus Mackay18-Oct-07 23:24 
GeneralRe: nextline Pin
zeeShan anSari18-Oct-07 23:38
zeeShan anSari18-Oct-07 23:38 

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.