Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.Formatter;

public class Main {
    public static void main(String[] argv) throws Exception {
        Formatter fmt = new Formatter();
        fmt.format("Default precision: %f\n", 10.0 / 3.0);
        fmt.format("Two decimal digits: %.2f\n\n", 10.0 / 3.0);
        System.out.println(fmt);

    }
}