So if I am looking at this piece of code:
public Plugboard(String wires) throws InvalidPlugboardWiresException
What exactly does the throws InvalidPlugboardWiresException
mean?
So if I am looking at this piece of code:
public Plugboard(String wires) throws InvalidPlugboardWiresException
What exactly does the throws InvalidPlugboardWiresException
mean?
It declares that this method may throws InvalidPlugboardWiresException exception. Here is a description on how to throw and catch exceptions in methods: enter link description here
This is information that this constructor can throw InvalidPlugboardWiresException
. You should handle this exception in place where you are using it.
Remember that the most dangerous thing you can do is catch an exception and do nothing with it.