initialize scanner java

Java
Scanner sc=new Scanner(System. in);
Source

Also in Java: