Link to home
Start Free TrialLog in
Avatar of Squadless
Squadless

asked on

java equivalent of cout.setwidth();

what is the java equivalent of the C++ term:

cout.setwidth(5);
or
cout.setw(5);

I basically need to lineup the columns after 5 empty characters.

Thanks
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Use System.out.printf
Avatar of Squadless
Squadless

ASKER

and where do i specify the width? System.out.printf(5)?
SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
you again!