What will be the output of the following program?
public class PrintStatment2
{
public static void main(String args[])
{
System.out.print(formatDouble(-0.0) + " ");
System.out.print(formatDouble(0.0) + " ");
System.out.print(formatDouble(1.0) + " ");
System.out.print(formatDouble(1.2) + " ");
}
public static String formatDouble(double x)
{
return String.format("%.17g", x).replaceFirst("\\.?0+(e|$)", "$1");
}
}