java - how readUTF() method of DataInputStream finish form Keyboard? -
this test:
datainputstream dis=new datainputstream(system.in); system.out.println("enter name: "); string name=dis.readutf(); system.out.println("ten vua nhap: "+name);// want print
after input text keyboard, want finish , print text, programm still not finish.. how can deal this.
you can scanner class
scanner input = new scanner(system.in); system.out.println("enter name: "); string name= input.nextline(); system.out.println("ten vua nhap: "+name);// want print
Comments
Post a Comment