Which one is correct and why:
String dynamic = new String(); dynamic = \" where id=\'\" + unitId + \"\'\"; Or String dynamic = \" where id=\'\" + unitId + \"
You can use like this.
StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("where id='"); stringBuilder.append(unitId); stringBuilder.append("'"); String dynamic = stringBuilder.toString();