Java examples for Language Basics:Number Format
Printing a space before non-negative values.
public class Main { public static void main(String[] args) { /*from w w w . jav a 2 s . co m*/ System.out.printf("% d\n% d\n", 547, -547); } }