public String toString() { StringBuilder result = new StringBuilder("{"); for (Map.Entry<Class<? extends Pet>, Integer> pair : entrySet()) { result.append(pair.getKey().getSimpleName()); result.append("="); result.append(pair.getValue()); result.append(", "); } result.delete(result.length() - 2, result.length()); result.append("}"); return result.toString(); }
public String toString() { StringBuilder result = new StringBuilder(); for (Object[] obj : fields) { result.append(obj[0]); result.append(": "); result.append(obj[1]); result.append("\n"); } return result.toString(); }
public String toString() { StringBuilder result = new StringBuilder(); for (int i = 0; i < index; i++) { result.append(pairs[i][0].toString()); result.append(" : "); result.append(pairs[i][1].toString()); if (i < index - 1) result.append("\n"); } return result.toString(); }
public String toString() { StringBuilder sb = new StringBuilder(); for (int i = 0; i < sArray.length; i++) sb.append((sArray[i] + " ")); return sb.toString(); }