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