public class ShoppingItem { public String name = ""; public double value = 0; public ShoppingItem(String name, double value) { this.name = name; this.value = value; } public void show(int iterator) { System.out.println(Justified.justify(Justified.RIGHT, 5, iterator + ". ") + Justified.justify(Justified.LEFT, 11, this.name + " ") + Justified.justify(Justified.RIGHT, 10, String.format("%.2f", this.value) + " zl")); } }