| | |
Character class help..
![]() |
•
•
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 |
2dgraphics 3d @param affinetransform android api applet application arc arguments array arrays automation banking binary bluetooth byte chat chatprogramusingobjects class client code color compare component count database design detection eclipse eclipsedevelopment encryption error fractal game givemetehcodez graphics gridlayout gui guitesting helpwithhomework html ide if_statement image input integer interface j2me java java.xls javadesktopapplications javaprojects jni jpanel julia keytool keyword linux list loop macintosh map method methods mobile netbeans newbie object os pong problem producer program programming project projectideas read recursion reference replaysolutions rim scanner server set size sms sort sql string swing terminal threads transforms tree ui unicode validation web windows






