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 the difference between dynamic and var in c#?

454


What is the implicit name of the parameter that gets passed into the class set method?

482


What is the benefit of interface in c#?

469


What is array and arraylist?

532


Can we inherit abstract class in c#?

477






How do you escape c#?

498


Does c# have primitives?

471


What will be the output of the following code?

504


What is overloading with example?

491


What is constants in c#?

417


Is java better than c#?

510


Explain more on CLR

742


What is the root element of an xml file?

490


Can a abstract class have a constructor?

459


Distinguish between the Debug class and Trace class with its functionality?

527