This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I'm writing a program whereby I'm accepting input form the keyboard, converting it to a String, and then displaying it. Firstly however, I want to check whether the inputted value comprises more than 1 charcater or not. I've done the following :-
In other words, if I enter the value '22' at the keyboard, because it comprises of more than one digit, i want the program to print "two digits present!". But it doesn't work - nothing happens. What am I doing wrong here? [ December 23, 2002: Message edited by: Marilyn de Queiroz ]
John Bonham was stronger, but Keith Moon was faster.
args is an array with all command line arguments (however many there are). args is the String representing the first argument (if there is one). So you want to look at args.length() rather than args.length. Of course, make sure args.length > 0 before trying to access args.