In Main function another function is there and to that
function if we pass string as parameter ,then that string
value is passed by value or reference type?
Answer Posted / sultan
parameters are passed byvalue unless defined to be passed
as ref,
try this
inside MAIN
{
string a = "a";
console.writeline(a);
foo(a);
console.writeline(a);
foo1(ref a);
console.writeline(a);
console.readkey();
}
foo(string a)
{
a="b";
}
foo1(ref string a)
{
}
}
result:
a
a
b
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Explain the role of Garbage collector and its generations?
How many parameters can a method have c#?
What is the difference between ienumerable and enumerable?
What is poco c#?
What is the usage of transponders?
What is a interface in c#?
Explain About DTS package
What is asp net c# corner?
How to use session under class file of APP_Code folder?
Define property in c#.net?
Is boxing an implicit conversion?
What is state c#?
What is executenonquery c#?
What is #region in c#?
What is a decimal in c#?