Hello, I am new to Java, though i am familiar with C, C++ and VB. I cant get through the syntax for accepting a number from the keyboard. Have tried Integer.parseInt(args[0]), but it gives an error. Please help
Hello, I am new to Java, though i am familiar with C, C++ and VB. I cant get through the syntax for accepting a number from the keyboard. Have tried Integer.parseInt(args[0]), but it gives an error. Please help
Hello cuteanu, welcome to the forums.
You could use the Scanner class to read user input from the keyboard.
http://www.javaprogrammingforums.com...ner-class.html
If you wish to send numbers on the command line when you first launch the application, this will work fine:
Code :public static void main(String[] args) { int myInt = Integer.parseInt(args[0]); System.out.println(myInt); }