Classification of cases that cause compile errors and cases that cause run-time errors.
BiFunction<Integer, Double, Integer> function = (x, y) -> x + y;
function.apply(1, 2.5);
(int)(x + y)
Orbifunction<integer, double, double>
Needs to be fixed.
FileInputStream can call reset () but does not support it. Supported by the child class BufferedInputStream.
new FileInputStream("src/a/a.txt").reset();
//=> java.io.IOException: mark/reset not supported
Reset () of InputStream of parent class
public synchronized void reset() throws IOException {
throw new IOException("mark/reset not supported");
}
Reset () of BufferedInputStream of child class
public synchronized void reset() throws IOException {
getBufIfOpen(); // Cause exception if closed
if (markpos < 0)
throw new IOException("Resetting to invalid mark");
pos = markpos;
}
Recommended Posts