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 a generic c#?

499


Do void methods have parameters?

496


How assembly versioning in .NET prevent DLL Hell problem?

515


What is boxing & unboxing?

572


What is the base class from which all value types are derived?

501






How can encapsulation be achieved?

604


What is Global Assembly Cache (GAC) and what is the purpose of it? (How to make an assembly to public? Steps) How more than one version of an assembly can keep in same place?

568


What is dll hell, and how does .net solve it?

535


What can I create with c#?

490


How is a strongly-named assembly different from one that isn’t strongly-named?

610


Why do we use methods in c#?

477


What is difference between gridview and form view?

538


What do u meant by "SBI" of an object?

538


What are the differences between system.string and system.text.stringbuilder classes?

486


How do I format a string in c#?

482