String today = someSimpleDateFormat.format(new Date());
Calendar rightNow = Calendar.getInstance();
int hour = rightNow.get(Calendar.HOUR_OF_DAY);
int minute = rightNow.get(Calendar.MINUTE);
String hourString = String.valueOf(hour);
String minuteString = String.valueOf(minute);
if(hourString.length() == 1){
hourString = '0'.concat(hourString);
}
if(minuteString.length() == 1){
minuteString = '0'.concat(minuteString);
}
String dayHourMinute = today.concat("_").concat(hourString).concat("_").concat(minuteString);
I could have used '+' operator. Would there be any performance issue if I have lots of string concatenation in the program and I use '+' operator over the 'concat' method or viceversa?