-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResultImpl.java
More file actions
20 lines (18 loc) · 855 Bytes
/
Copy pathResultImpl.java
File metadata and controls
20 lines (18 loc) · 855 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.logging.Level;
public class ResultImpl extends BaseClass implements Result {
@Override
public void printResult() {
try {
Object priceCalculationObject = PriceCalculation.class.getDeclaredConstructor().newInstance();
Method printResult = priceCalculationObject.getClass().getDeclaredMethod("printResult");
printResult.setAccessible(Boolean.TRUE);
printResult.invoke(priceCalculationObject);
BigDecimalMethodsExample bigDecimalMethodsExample = new BigDecimalMethodsExample();
bigDecimalMethodsExample.printResult();
} catch (NoSuchMethodException | InvocationTargetException | InstantiationException | IllegalAccessException exception) {
logger.log(Level.SEVERE, exception.getMessage());
}
}
}