Break up a string literal over multiple lines
Break up the string on the new line using +
operator works.
public String toString() {
return String.format("BankAccount[owner: %s, balance: "
+ "%2$.2f, interest rate:"
+ " %3$.2f]",
myCustomerName,
myAccountBalance, myIntrestRate);
}
Sample Output: BankAccount[owner: TestUser, balance: 100.57, interest rate: 12.50]