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
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 |
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 |
Answer / madeshwaran
It will be passed as a value not as a reference.
| Is This Answer Correct ? | 1 Yes | 1 No |
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 |
Explain the difference between pass by value and pass by reference.
How to run the program at particular time? It should run everyday at 3:00 PM. After executing the program should sleep until next day at 3:00 PM. Please explain with code?
What is class sortedlist underneath?
What are the different types of delegation?
List down the differences between “dispose” and “finalize” methods in c#.
Why do we need serialization?
Is arraylist thread safe?
List out the differences between array and arraylist in c#?
Explain the serialization in .net
How can an inner class access the members of outer class?
Difference between call by value and call by reference in C#?
How do I create a single-file assembly?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)