Is this possible!!?!?!?!?
I\'m trying to make a set of classes that model a number of different types of things. Properties of these things change over time, and I want
The normal way of doing this is to store the 'name' as a variable in the instance, for ex:
// Initialize this like: var cat = new Cat("Tiger");
class Cat {
public String Name { get; private set; }
public Cat(String name)
{
Name = name;
}
}
And then if you need to get tigers in more than one place, make it into a method that explicitly returns Tigers:
// This can go into a class of cat-creating static methods. Or maybe in the Cat class itself.
public static Cat GiveMeATiger() {
return new Cat("Tiger");
}