int i1=-123;
int i2=12345;
System.out.printf(">%1$(7d< \n", i1);
System.out.printf(">%0, 7d< \n", i2);
cmbhatt
Originally posted by nik arora:
Hi chandra,
In case of second output after 012 why "," has come.When the below line is executed output is +12345 i am not understanding can you explain me
System.out.printf(">%+-7d< \n", i2);
"," Use local-specific grouping separators (i.e. the comma in 123,456)
cmbhatt
Originally posted by nik arora:
Hi Chandra,
Look at the below statement
i2=12345;
System.out.printf(">%0, 7d< \n", i2);
The output produced for this is 012,345 why after 012 the "," has come.
cmbhatt
The output produced for this is 012,345 why after 012 the "," has come.
cmbhatt
cmbhatt
Originally posted by nik arora:
HI Megha,
Why the "," is coming after 012?
Originally posted by nik arora:
HI JOHN,
When the below statement is executed the output is
>+12345<. Can you explain me how?
i2=12345;
System.out.printf(">%+-7d< \n", i2);
cmbhatt