Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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?

Answers were Sorted based on User's Feedback



In Main function another function is there and to that function if we pass string as parameter ,the..

Answer / venkatpyla

it is not possible to define the another function in one
function,please give some clarification on the question. if
it is related to calling another function in one function by
default passing parameter is Valueby

Is This Answer Correct ?    2 Yes 0 No

In Main function another function is there and to that function if we pass string as parameter ,the..

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

In Main function another function is there and to that function if we pass string as parameter ,the..

Answer / madeshwaran

It will be passed as a value not as a reference.

Is This Answer Correct ?    1 Yes 1 No

In Main function another function is there and to that function if we pass string as parameter ,the..

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

More C Sharp Interview Questions

Is lazy t thread safe?

0 Answers  


What is the use of private constructor in c#?

0 Answers  


What is generic types in c#?

0 Answers  


What is a sealed class?

0 Answers  


What is the difference between a field and a property in c#?

0 Answers  


Can you store multiple data types in System.Array?

20 Answers   Satyam, Siebel Systems,


What is use of singleton class in c#?

0 Answers  


How do you comment in c#?

0 Answers  


What do you mean by synchronous and asynchronous operations?

0 Answers  


What is oledb in c#?

0 Answers  


How to find Percentage, name ,College from a resume or document ? How to export these values to other page in C#?

0 Answers   CDC,


What is datacontract in c#?

0 Answers  


Categories