public static void appendColumns(StringBuilder s,String[] columns){
  int n=columns.length;
  for (int i=0; i < n; i++) {
    String column=columns[i];
    if (column != null) {
      if (i > 0) {
        s.append(", ");
      }
      s.append(column);
    }
  }
  s.append(' ');
}

public static void appendColumns ( StringBuilder s , String [ ] columns ) { int n = columns . length ; for ( int i = 0 ; i < n ; i ++ ) { String column = columns [ i ] ; if ( column != null ) { if ( i > 0 ) { s . append ( ", " ) ; } s . append ( column ) ; } } s . append ( ' ' ) ; }
add the names that are non - null in columns to s , separating them with commas .
