how to initalize scanner in java code example Example: initialize scanner java Scanner sc=new Scanner(System. in);