Constructor?

If i have a bool variable called "bool IsNew = false" and i have a class called customers....If i have a constructor like

public Customers()

{

IsNew = True;

}

Is adding this in my constructor say that every time this class is loaded...IsNew is true?

[297 byte] By [Tryin2Bgood] at [2007-12-24]
# 1
(Was this a real post or somekind of a joke...?)

Yes, constructor sets the value of the IsNew to true for every Customer object that is initialized. You can also define InNew to true. private bool isNew = true;

rauhanlinnake at 2007-10-8 > top of Msdn Tech,Visual C#,Visual C# Language...
# 2

Assuming that is the only constructor, then Yes, IsNew will always be initially set to true.

OF course, you can design more that one constructor, and if you were to define one like :

public Customer(String name)
{
this.Name = name;
}

without resetting IsNew, then IsNew will retain it's first value of false.

JamesCurran at 2007-10-8 > top of Msdn Tech,Visual C#,Visual C# Language...