943,961 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 2116
  • Java RSS
Feb 2nd, 2006
0

Character class help..

Expand Post »
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;
}
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
BaileyFree is offline Offline
7 posts
since Jan 2006
Feb 3rd, 2006
0

Re: Character class help..

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)
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Feb 3rd, 2006
0

Re: Character class help..

er may I enquire how do i use character.isDigit in this place then??
Reputation Points: 10
Solved Threads: 0
Newbie Poster
BaileyFree is offline Offline
7 posts
since Jan 2006
Feb 3rd, 2006
0

Re: Character class help..

read the language documentation.
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Internal Frames
Next Thread in Java Forum Timeline: putting an image





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC