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
What is a delegate? How can it works?
What is dependency injection in simple words?
What are partial types in c#?
Why would you use untrusted verification?
Define using statement in c#?
Explain the difference between const and static read-only?
Can we override constructor in c#?
Define thread?
Ho we can see assembly information?
Does c# support properties of array types?
Is it possible to restrict the scope of a field/method of a class to the classes in the same namespace?
What is the difference while using directive vs using statement ?
Difference between value and reference type.
There were a lot of questions asked, so I will list the topic (and add a what is "topic" and know pros/cons). Extreme programming, what is a transaction, various SDLC design approaches, what is a namespace, define a good test case, what is a stored proc, webservice? design patterns? linker? compiler? access modifiers? stack vs. queue? arrays vs. linked lists? sorting algorithms? recursion? OOP principles?
Which attribute adorn a test class to be picked up by the NUnit GUI in the NUnit test framework?