X-Git-Url: http://svarog.pmf.uns.ac.rs/gitweb/?p=spa2-materijali.git;a=blobdiff_plain;f=Hash%2Fhash.txt;h=6c2075ab988fc8d91777ab05cf56d4f2ab31bdb1;hp=75e8cc753cac2811c467d743c443376bd8ad6de2;hb=823f42e60101748b10cb61752c09a66eb115b594;hpb=f734195b4c499d152fd3b996839668530fa3868b diff --git a/Hash/hash.txt b/Hash/hash.txt index 75e8cc7..6c2075a 100644 --- a/Hash/hash.txt +++ b/Hash/hash.txt @@ -283,12 +283,19 @@ Potpuna verzija bi izgledala ovako: // pretvaramo objekat u kancelariju Kancelarija k2 = (Kancelarija) o; - // poredimo polja - if (prezime.equals(k2.prezime) && broj == k2.broj) { - return true; + + // Prvo proveravamo broj + if (broj != other.broj) { + return false; } - return false; + // A potom prezime + if (!Objects.equals(prezime, other.prezime)) { + return false; + } + + // Proverili smo polja i sva su jednaka + return true; } ```