| | |
Character class help..
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jan 2006
Posts: 7
Reputation:
Solved Threads: 0
hi I know that I have asked pretty much question recently.. I'm learning java myself and hence kinda can't really understand
the isDigit method..
error is cannot resolve symbol method isDigit(char)
I imported java.lang.* as well already .
public static boolean DigitValidation(String colour)
{
boolean flag = true;
for (int i =0; i<colour.length();i++)
{
char ch = colour.charAt(i);
if (colour.isDigit(ch))
{
flag= false;
break;
}
else flag = true;
}
return flag;
}
the isDigit method..
error is cannot resolve symbol method isDigit(char)
I imported java.lang.* as well already .
public static boolean DigitValidation(String colour)
{
boolean flag = true;
for (int i =0; i<colour.length();i++)
{
char ch = colour.charAt(i);
if (colour.isDigit(ch))
{
flag= false;
break;
}
else flag = true;
}
return flag;
}
well, there is no isDigit method in String, which is what you're calling.
There is a static one in Character, which I guess you're thinking you're calling.
But you need to do that differently, something like Character.isDigit(ch)
There is a static one in Character, which I guess you're thinking you're calling.
But you need to do that differently, something like Character.isDigit(ch)
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
![]() |
Similar Threads
- C++ .NET Character class errors (C++)
- help with cheacking in 3D Tic-Tac-Toe (C++)
- Quick Project Question{ (Java)
- Validate textboxes (HTML and CSS)
- Someone help me hate trees less (Java)
Other Threads in the Java Forum
- Previous Thread: Internal Frames
- Next Thread: putting an image
| Thread Tools | Search this Thread |
911 actionlistener addressbook android api append applet application array arrays automation binary bluetooth character chat class classes client code component consumer csv database desktop draw eclipse error event exception fractal ftp game givemetehcodez graphics gui html ide image input integer j2me japplet java javaarraylist javac javaee javaprojects jmf jni jpanel julia linked linux list loop map method methods mobile netbeans newbie objects online oracle oriented panel print printf problem program programming project projects properties recursion replaydirector reporting researchinmotion robot rotatetext rsa scanner screen se server set size sms sort sql string swing template test threads time tree ubuntu update windows






