Member object instantiation in onCreate vs. during declaration

Viewed 1228

I am basically asking about the difference between these two approaches:

public class myClass extends AppCompatActivity {
    private objectType mObject = new objectType();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        //do stuff with mObject

and

public class myClass extends AppCompatActivity {
    private objectType mObject;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        mObject = new ObjectType();

I hope I'm being clear enough. I am struggling to understand when we'd want to choose one versus the other.

2 Answers
Related