Mega Code Archive

 
Categories / Java Tutorial / Development
 

Printing numbers with and without the + flag

public class MainClass  {    public static void main( String args[] )    {        System.out.printf( "%d\t%d\n", 786, -786 );       System.out.printf( "%+d\t%+d\n", 786, -786 );    } } 786-786 +786-786