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 name = cnsl.readLine("Name: ");

            System.out.println("Name entered : " + name);
        }

    }
}