SHARE

Classes in Java can have as many constructors as you like. Using “overloading” you can create an Object with different parameters. You can have constructors with no parameters, some with, some with partial amounts… What ever you like.

Here’s an example.

This only real issue that you will run into is if you doing something like this…

That’s because Java can’t discern between the two. Both will be passed a String. How does Java know if it’s a name or a colour? It doesn’t.

Until next time, Josh.