/**---------------------------------------------------------*
* @author Madarapu Naveen *
* http://madarapunaveen.blogspot.com *
* ---------------------------------------------------------*
*/
public class CharacterIsDigit {
public static void main(String[] args) {
String numbers = "1234567890";
for (int i = 0; i < numbers.length(); i++) {
if (Character.isDigit(numbers.charAt(i))) {
System.out.println(numbers.charAt(i)
+ " is a number.");
}
else {
System.out.println(numbers.charAt(i)
+ " not a number.");
}
}
}
}
This blog is for one who learn about java and open source tools. as a java developer i am writing my experience in this blog.
Friday, March 4, 2011
How do I check if a character representing a number?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment