im trying to format this string into a fixed column style but cant get it to work, heres my code, whats up?
System.out.format("%32s%10n%32s%10n%32s%10n", "Voter: " + e.voteNo + "Candidate: " + vote + "Booth: " + boothId);
All variables are integers,
I want the output to be like
Voter: 1 Candidate: 0 Booth: 1
Thanks
Please stop trying to program by accident. Your code looks like the glued-together parts of 3 different approaches to solving the issue. Try to read the documentation on the topic (JavaDoc is your friend!) and apply what you learned instead.
For more information on
String.formatcheck its JavaDoc.Edit: apparently I didn’t get the memo that there’s actually a
PrintStream.format, so you can actually write it like this: