[BAEL-9635] - Moved Junit vs TestNg junit code examples to junit-5 module from core-java
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
package com.baeldung.throwsexception;
|
||||
|
||||
public class Calculator {
|
||||
|
||||
public double divide(double a, double b) {
|
||||
if (b == 0) {
|
||||
throw new DivideByZeroException("Divider cannot be equal to zero!");
|
||||
}
|
||||
return a/b;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.baeldung.throwsexception;
|
||||
|
||||
public class DivideByZeroException extends RuntimeException {
|
||||
|
||||
public DivideByZeroException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user