This is the code I am working with.
public void displayCustomerInfo() {
System.out.println(Name + Income);
}
I use a separate main method with this code to call the method above:
first.displayCustomerInfo();
second.displayCustomerInfo();
third.displayCustomerInfo();
Is there a way to easily add spaces between the outputs? This is what it currently looks like:
Jaden100000.0
Angela70000.0
Bob10000.0
解决方案
Add a literal space, or a tab:
public void displayCustomerInfo() {
System.out.println(Name + " " + Income);
// or a tab
System.out.println(Name + "\t" + Income);
}