Results 1 to 5 of 5
- 11-22-2010, 08:52 AM #1
Member
- Join Date
- Nov 2010
- Location
- Beirut, Lebanon
- Posts
- 36
- Rep Power
- 0
small problem, thanks in advance for your help
so this part of my code doesnt seem to compile:
if ((len < 6) || (len > 15))
{
System.out.println("rule1 violated");
}
else
{
int charCount = 0;
int intCount = 0;
for(int i = 0; i < len; i++)
{
charCount = ((i > 65 && i < 90) || (i > 97 && i < 122));
charCount++;
intCount = (i > 48 && i < 57);
intCount ++;
}
}
im writing a password check program and one of the rules is to have at least a letter and at least a number but for charCount = ((i>65.....)) it says :incompatible types found boolean but expected int
any suggestions?
- 11-22-2010, 09:05 AM #2
charCount is an integer variable which has return type of boolean.Thats why u got the error.
First learn the basics in sun site ,then you start working on code.Ramya:cool:
- 11-22-2010, 09:34 AM #3
Member
- Join Date
- Nov 2010
- Location
- Beirut, Lebanon
- Posts
- 36
- Rep Power
- 0
i sorted out my problem.
thank you
- 11-22-2010, 10:24 AM #4
Member
- Join Date
- Nov 2010
- Location
- Beirut, Lebanon
- Posts
- 36
- Rep Power
- 0
i used the isLetter and isDigit instead
- 11-22-2010, 10:26 AM #5
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,716
- Rep Power
- 19
Similar Threads
-
How to advance ?
By House in forum New To JavaReplies: 14Last Post: 08-29-2010, 04:29 AM -
small problem
By rawan in forum Java AppletsReplies: 2Last Post: 04-07-2010, 04:32 AM -
Advice for Advance projects?
By suyash89 in forum Advanced JavaReplies: 7Last Post: 01-02-2010, 11:51 PM -
small problem
By barusk in forum NetworkingReplies: 4Last Post: 03-21-2009, 07:19 AM -
Small problem
By ayoood in forum New To JavaReplies: 2Last Post: 06-06-2008, 01:27 PM
Bookmarks