scanner java read from console code example Example: java how to write something on the console with scanner Scanner scanner = new Scanner(System.in);