I have a method that I would like to use in different occasions. That means that I want to use the method but each time pass in a different amount of arguments:

Consider this example:

```
public checkInput(Object a, Object b, Object c, Object d) {
    a.someMethod();
    b.someMethod();
    c.someMethod();
    d.someMethod();
}

```

Now I can only use this method `checkInput(...)` when I pass in 4 parameters. However, there are occasions where I only can pass in two parameters for example.

If I would like to call the method like this `checkInput(a, b, null, null);` I will get a `NullPointerException`. 

So now I am wondering, will I have to use overloading in this case, meaning that I will have to create 

```
public checkInput(Object a) {
    a.someMethod();
}

public checkInput(Object a, Object b) {
    a.someMethod();
    b.someMethod();
}

```

... and so on.