public static void main(String[] args) {Scanner scanner = new Scanner(System.in);String str = null;while((str=scanner.nextLine())!=null){if(str.equals("exit")){break;}System.out.println(str);}}
类型无法转换,scanner 不能转换为string