G
garethrichardadams
Hello all,
If you've got a class, say StateManager. That class has got a stack. Is
there any difference between initialising the stack when the variable
is created and initialising the stack in the constructor???:
public class StateManager
{
Stack<GameState> m_stack = new Stack<GameState>();
}
OR
public class StateManager
{
Stack<GameState> m_stack;
public StateManager()
{
m_stack = new Stack<GameState>();
}
}
Thanks
Gareth
If you've got a class, say StateManager. That class has got a stack. Is
there any difference between initialising the stack when the variable
is created and initialising the stack in the constructor???:
public class StateManager
{
Stack<GameState> m_stack = new Stack<GameState>();
}
OR
public class StateManager
{
Stack<GameState> m_stack;
public StateManager()
{
m_stack = new Stack<GameState>();
}
}
Thanks
Gareth