I would like to create a class with properties that have subproperties...
In other words, if I did something like:
Fruit apple = new Fruit();
I would want something like:
apple.eat(); //eats apple
MessageBox.Show(apple.color); //message box showing "red"
MessageBox.Show(apple.physicalProperties.height.ToString()); // message box saying 3
I would think it would be done like:
class Fruit{
public void eat(){
MessageBox.Show("Fruit eaten");
}
public string color = "red";
public class physicalProperties{
public int height = 3;
}
}
...but, if that were working, I wouldn't be on here...