TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Maha
NA
0
325k
Reference type
Sep 26 2013 11:22 AM
Data type string is a reference type. Therefore it will not create any copy in program, changes alter the result. In the following program o/p expected was:
X
Copy X
Copy A
But o/p was:
X
Copy X
Copy X
using System;
class Program
{
static void Main()
{
string s = "X";
string copy = s;
Console.WriteLine(s);
Console.WriteLine("Copy " + copy);
s = "A";
//Now "s" has been changed
Console.WriteLine("Copy " + copy);
Console.ReadKey();
}
}
/*
X
Copy X
Copy X
*/
Reply
Answers (
7
)
C# Programming Question
four line in textbox save in multiple excel columns c#.net W