September 2019
Intermediate to advanced
816 pages
18h 47m
English
To begin with, let's have a simple scenario to highlight this problem. This scenario may materialize in the following simple class:
public class Function { private final int x; public Function(int x) { this.x = x; } public int xMinusY(int y) { return x - y; } public static int oneMinusY(int y) { return 1 - y; }}
Notice that the preceding snippet of code doesn't assume any range restrictions over x and y. Now, let's impose the following ranges (this is very common with mathematical functions):