void (Object obj) { String temp = (String) obj; if (obj instanceof String) { System.out.println(temp.trim()); System.out.println(temp.trim()); System.out.println(temp.trim()); } if (obj instanceof String) { System.out.println(temp.trim()); System.out.println(temp.trim()); System.out.println(temp.trim()); } }