I'm trying to figure out what is the difference between:
public partial class TestWindow : Window
{
object obj = new object();
public TestWindow()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
}
}
and:
public partial class TestWindow : Window
{
object obj;
public TestWindow()
{
InitializeComponent();
obj = new object();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
}
}
and:
public partial class TestWindow : Window
{
object obj;
public TestWindow()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
obj = new object();
}
}
it looks like they all act the same and i wonder if there's any important difference between them, or is it just a "best practice" thing to choose one of them. Thanks in advance