





Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Various aspects of handling equality, overriding equals and hashcode, preconditions, dealing with errors, signaling errors, and using exceptions in java. It covers the concept of structural equality, the use of the equals() method, the importance of overriding hashcode(), preconditions, error handling, signaling errors with different styles, problems with these approaches, and the use of exceptions as a form of non-local control-flow.
Typology: Study notes
1 / 9
This page cannot be seen from the preview
Don't miss anything!






68
70
// Return maximum element in A[i..j] int findMax(int[] A, int i, int j) { ... }
74
76
if (i >= 0 && i < a.length ) return a[i]; else throw new ArrayIndexOutOfBounds();
80
while ((s = ...) != null) { try { FileInputStream f = new FileInputStream(s); ... } catch (FileNotFoundException e) { System.out.println(s + “ not found”); } } 81
82