public String readUserInput(String printMessage) throws IOException{
System.out.println(printMessage);
InputStreamReader isr = new InputStreamReader ( System.in );
BufferedReader br = new BufferedReader (isr);
String returnString;
try {
returnString=br.readLine();
} catch (IOException e) {
String message="error while reading user input";
log.error(message,e);
throw new IOException(e);
}
finally {
br.close();
isr.close()
}
return returnString;
}
I hope to share my knowledge with the others in software and networking industry
How to read user input at command line -Java
Subscribe to:
Post Comments (Atom)
Empowering the Future of API Management: Unveiling the Journey of WSO2 API Platform for Kubernetes (APK) Project and the Anticipated Alpha Release
Introduction In the ever-evolving realm of API management, our journey embarked on the APK project eight months ago, and now, with great a...
-
First you have to download the font file "filename.ttf" to you machine. Then you need some permissions to add those files to fold...
-
Remove current installation of Nginx sudo apt-get purge nginx nginx-common nginx-full Install Nginx sudo apt-get install nginx Edit c...
-
Here i'm explaining solution for manage multiple API Manager environments and external key management server to build central API r...
No comments:
Post a Comment