java read from console

java read from console

Read from console and write again to console

import java.io.Console;

public class ConsoleRead {

 public static void main(String[] args) {

  System.out.println("Enter Text on Console");
  Console c = System.console();
  String s = c.readLine();
  System.out.println(s);

 }

}