The documentation for the java programming language


Question: The documentation for the Java programming language recommends that when a boolean "equals method" is defined for an object, it should be an equivalence relation. That is, if r is defined by xry 4 x.equals(y) for all objects in the class, then r should be an equivalence relation. In a graphics application, a programmer creates an object called a point, consisting of two coordinates in the plane. The programmer defines an equals method as follows: If p and q are any two points in the plane, then where c is a small positive number that depends on the resolution of the computer display. Is the programmer's equals method an equivalence relation? Justify your answer.

Solution Preview :

Prepared by a verified Expert
Mathematics: The documentation for the java programming language
Reference No:- TGS02432082

Now Priced at $15 (50% Discount)

Recommended (90%)

Rated (4.3/5)