Just a quick form question. In the following code, is there a better way to concatinate the strings (i.e. can I just set tmpError equal to the new string rather than adding it?)
public void validate () throws Exception {
String tmpError = "";
if(paramA == null) tmpError = tmpError + "paramA was not set";
if(paramB == null) tmpError = tmpError + "paramB was not set";
if(paramC == null) tmpError = tmpError + "paramC was not set";
if(!tmpError.equalsIgnoreCase("")){
tmpError = "error occured" + tmpError;
throw new Exception(tmpError);
}
}
Thanks in advance