0

Hey,

So, I have a class that has a bunch of info, the usual set/get methods. But my question is, I'm adding them all together in another method, and I don't know how you get it all in a nice table like format, with all the columns/rows being equal and what not...

So, I have first name, last name, social security number, and when I print this out, it's like so:

Bob Parly: SSN#: 123-45-6789
Anthony Frenkstene: SSN#: 987-65-4321

So, see how it is not aligned at all? So, how can I get it to push the SSN# column out, so that it looks better/more professional?

Again, I'm using a String.format, and

public String getWorker()
    {
        return String.format("%s %s:  SSN#: %d ", firstName, lastName, SSN);
    }

Any help would be appreciated, and thanks!
Justin W.

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by justinwarner
0

Don't see how to delete, but if anyone else has this problem, you add the numbers between the % and the letter (Flag), so like, &2s would add 2 spaces to it, and to go the other way, you use the - sign... I ended up finding it shortly after, sorry!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.