In below example why should I type cast " CellPhone cellPhone = (CellPhone) o;" instead of directly accessing "Objects.equals(vendor, o.vendor) && Objects.equals(model, o.model);" ?. When I use "o." it gives oblect not found though its passed as part of parameter. @Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } CellPhone cellPhone = (CellPhone) o; return Objects.equals(vendor, cellPhone.vendor) && Objects.equals(model, cellPhone.model); }