lots of exercises in java... from https://github.com/exercism/java

ErrorHandling.java 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import java.util.Optional;
  2. class ErrorHandling {
  3. void handleErrorByThrowingIllegalArgumentException() {
  4. throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
  5. }
  6. void handleErrorByThrowingIllegalArgumentExceptionWithDetailMessage(String message) {
  7. throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
  8. }
  9. void handleErrorByThrowingAnyCheckedException() {
  10. throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
  11. }
  12. void handleErrorByThrowingAnyCheckedExceptionWithDetailMessage(String message) {
  13. throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
  14. }
  15. void handleErrorByThrowingAnyUncheckedException() {
  16. throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
  17. }
  18. void handleErrorByThrowingAnyUncheckedExceptionWithDetailMessage(String message) {
  19. throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
  20. }
  21. void handleErrorByThrowingCustomCheckedException() {
  22. throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
  23. }
  24. void handleErrorByThrowingCustomCheckedExceptionWithDetailMessage(String message) {
  25. throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
  26. }
  27. void handleErrorByThrowingCustomUncheckedException() {
  28. throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
  29. }
  30. void handleErrorByThrowingCustomUncheckedExceptionWithDetailMessage(String message) {
  31. throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
  32. }
  33. Optional<Integer> handleErrorByReturningOptionalInstance(String integer) {
  34. throw new UnsupportedOperationException("Delete this statement and write your own implementation.");
  35. }
  36. }