Printing a space before non-negative values. - Java Language Basics

Java examples for Language Basics:Number Format

Description

Printing a space before non-negative values.

Demo Code

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);
   } 
}

Result


Related Tutorials