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 / parmjit

even if string is a reference type, whenever we pass it to
another function, it is passed as refrence-value to that
function function.

If the actual parameter is a string constant using this
refrence the called function cannot change the passed
string, because strings are constant values cannot be
modified.


If the actual parameter is a variable holding a referance
to a string object, even the the called function neither
change the passed string value nor change the referance
stored in the original passed parameter.

Is This Answer Correct ?    2 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is global namespace in c#?

691


Can you mark static constructor with access modifiers?

726


How will you deploy the dll file in gac?

678


Is c# and c same?

662


what is be the overhead, if i use binary transmission. and will it be sent using xml text or how ?

1873


Can we set image Source dynamically using C# in WPF application?

839


What is an xsd file?

678


Can a dictionary have the same key?

703


Can you instantiate a struct without using a new operator in c#?

724


What is entity framework c#?

615


What is ildasm and obfuscator in net?

723


What is semaphore in c#?

685


What is IL / CIL / MSIL?

871


What is thread pooling?

716


Can int be null c#?

685