I have an object called MyDate and it return three methods String getDay(), String getYear(), String getMonth()
For example Sep 24 2013 will 2013, 24, 9 .. I want to join these three strings using a common separator which is DASH "-". How do I join without using StringBuilder or "+" operator ? What would be the most compact code form ?
For e.g I know I can do this but is there a more compact form ? Because I know + operator is expensive.
MyDate myDate = new MyDate();
myDate.getYear()+"-"+myDate.getMonth()+"-"+myDate.getDay();
+orStringBuilder?