Here I am adding some `Fragment`s to `List` in a static method.

```
public static List<Fragment> TOOLS(){
        List<Fragment> fragments=new ArrayList<>();
        fragments.add(new SubjectFragment());
        fragments.add(new ExamFragment());
        fragments.add(new AdminToolsFragment());
        return fragments;
    }

```

I am using this is because of my conveniences.
Early I used switch statement

```
switch (textView.getId()) {
            case R.id.subject:
                onButtonPressed(new SubjectFragment(), "Subject");
                break;
            case R.id.exam:
                onButtonPressed(new ExamFragment(), "exam");
                break;
            case R.id.tools:
                onButtonPressed(new AdminToolsFragment(), "adminTools");
                break;
}

```

Now instead of switch statement I used its position with `List`.
Like this.

```
fragments.get(position);

```

My question is arise when creating fragment objects

```
new MyFragment();

```

ie. Creating more and more instances is expensive. So in switch statement there is only **one instance** created at a time. But when using list

```
    fragments.add(new SubjectFragment());
    fragments.add(new ExamFragment());
    fragments.add(new AdminToolsFragment());

```

**Many instances** are created at a time.

Question is.
 **Is it adding fragments to list is bad for performance? if it is no then what is the reason?**