how to get console in java code example
Example 1: console log java
System.out.println(String msg)
Example 2: console java
try(Scanner scan=new Scanner(System.in)){
//read from console
String textRead=scan.nextLine();
//write to console
System.out.println(textRead);
}