Question: Which code snippet correctly declares a custom exception named InvalidResponse?
- struct InvalidResponse: Exception {}
- class InvalidResponse: Exception {}
- public Exception InvalidResponse = new Exception ();
- public Exception InvalidResponse () -> Exception;
Answer: The correct answer of the above question is Option B:class InvalidResponse: Exception {}