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
Digambar Malla
NA
5
3.9k
Confusion about object
Mar 18 2013 1:12 PM
class demo
{
int x=10;
public demo()
{
}
static void Main()
{
Console.WriteLine(new demo().x);
//1st line
new demo().x = 20;
//2nd line
Console.WriteLine(new demo().x);
demo d2=new demo();
d2.x = 30;
//3rd line
Console.WriteLine(d2.x);
Console.ReadLine();
}
}
What is the difference between 1st,2nd and 3rd line ??? Why the value is not assigned in 2nd line where as it is assigned in 3rd line ???
Reply
Answers (
1
)
foreign key
C# To Insert 3 Rows in Excel