1

So if I am looking at this piece of code:

public Plugboard(String wires) throws InvalidPlugboardWiresException

What exactly does the throws InvalidPlugboardWiresException mean?

Rob
  • 6,247
  • 2
  • 25
  • 33
AlleyCat
  • 165
  • 1
  • 2
  • 11
  • the method can throw a `InvalidPlugboardWiresException` or any of its subclasses (https://docs.oracle.com/javase/tutorial/essential/exceptions/declaring.html) – Andrew Tobilko Aug 10 '17 at 18:19

2 Answers2

0

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

0

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.

wpater
  • 393
  • 3
  • 14