Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.io.Console;

public class Main {
    public static void main(String[] args) throws Exception {

        Console cnsl = System.console();

        if (cnsl != null) {
            String fmt = "%1$4s %2$10s %3$10s%n";

            // format
            cnsl.format(fmt, "Items", "Level", "Price");
            cnsl.format(fmt, "-----", "-----", "-----");
            cnsl.format(fmt, "PHP", "1", "15");
            cnsl.format(fmt, "CSS", "2", "50");
            cnsl.format(fmt, "Java", "3", "30");
            cnsl.format(fmt, "HTML", "4", "80");
        }

    }
}