Код: Выделить всё
public String toString(){
string output = String.format("%4s -30s %3d %10.2f %11.2f", "CM01", "Computer Monitor",2, 114.9884, 229.96213)
Пример вывода выглядит следующим образом:
Код: Выделить всё
Code Item name QTY Unit Price Total Price
---- ------------------------------ --- ---------- -----------
CM01 Computer Monitor 2 114.98 229.96
В целом я понимаю, что делает каждый из них, но, думаю, сложить их вместе - нет.
Подробнее здесь: https://stackoverflow.com/questions/747 ... that-it-is
Мобильная версия