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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -