What was the error.
keep in mind you have to escape special characters like the &
http://www.mkyong.com/java/how-to-escap ... s-in-java/
Need help w/ java class
-
sirricealot
- Posts: 841
- Joined: Sat Feb 19, 2011 3:35 pm
Need help w/ java class
java:44: error: no suitable method found for inde.....
d.indexOf("!", "@", "#", "$", "%", "^","&", "*");
Somehow it has to include one of the 8 special characters
d.indexOf("!", "@", "#", "$", "%", "^","&", "*");
Somehow it has to include one of the 8 special characters
2006 Chevy Cobalt SS/NA 2.4L IL: FEERME7
2010 Kawasaki Ninja 250r IL: RUNYON
xbxlive: sirricealot07
ps3: sirricealot7
David Runyon
2010 Kawasaki Ninja 250r IL: RUNYON
xbxlive: sirricealot07
ps3: sirricealot7
David Runyon
-
Waffles
- Posts: 6876
- Joined: Mon Dec 11, 2006 3:45 am
-
sirricealot
- Posts: 841
- Joined: Sat Feb 19, 2011 3:35 pm
Need help w/ java class
This whole freaking program is confusing. It's like I was covered in meat and thrown into the lion cage on this one. His podcast/ppt don't help either. I've got the motorcycle safety course tonight and all weekend as well so looks like I'll probably be turning in a partial assignment on this week :/.Waffles;296967 wrote:Read the link I posted, it explains the error.
I'm missing the ability to read the special character constraint, and the ability to print which constraints are still not met. One of the disadvantages of taking an online class
2006 Chevy Cobalt SS/NA 2.4L IL: FEERME7
2010 Kawasaki Ninja 250r IL: RUNYON
xbxlive: sirricealot07
ps3: sirricealot7
David Runyon
2010 Kawasaki Ninja 250r IL: RUNYON
xbxlive: sirricealot07
ps3: sirricealot7
David Runyon
-
sirricealot
- Posts: 841
- Joined: Sat Feb 19, 2011 3:35 pm
Need help w/ java class
FML i was watching week 6 slideshow.
2006 Chevy Cobalt SS/NA 2.4L IL: FEERME7
2010 Kawasaki Ninja 250r IL: RUNYON
xbxlive: sirricealot07
ps3: sirricealot7
David Runyon
2010 Kawasaki Ninja 250r IL: RUNYON
xbxlive: sirricealot07
ps3: sirricealot7
David Runyon
-
sirricealot
- Posts: 841
- Joined: Sat Feb 19, 2011 3:35 pm
Need help w/ java class
Went through the slides and its still not clicking with me. Gonna email teacher I don't think I get it.
2006 Chevy Cobalt SS/NA 2.4L IL: FEERME7
2010 Kawasaki Ninja 250r IL: RUNYON
xbxlive: sirricealot07
ps3: sirricealot7
David Runyon
2010 Kawasaki Ninja 250r IL: RUNYON
xbxlive: sirricealot07
ps3: sirricealot7
David Runyon
-
Waffles
- Posts: 6876
- Joined: Mon Dec 11, 2006 3:45 am
Need help w/ java class
Change "&" to "\&"
& is a reserved character so you need the \ escape character.
& is a reserved character so you need the \ escape character.

-
sirricealot
- Posts: 841
- Joined: Sat Feb 19, 2011 3:35 pm
Need help w/ java class
You just made that part a lot easier :lol2:Waffles;296971 wrote:Change "&" to "&"
& is a reserved character so you need the escape character.
But implementing all 8 of the special characters into the string checking if one of any of them are in the password, thats the point where Im stuck
2006 Chevy Cobalt SS/NA 2.4L IL: FEERME7
2010 Kawasaki Ninja 250r IL: RUNYON
xbxlive: sirricealot07
ps3: sirricealot7
David Runyon
2010 Kawasaki Ninja 250r IL: RUNYON
xbxlive: sirricealot07
ps3: sirricealot7
David Runyon
-
Waffles
- Posts: 6876
- Joined: Mon Dec 11, 2006 3:45 am
Need help w/ java class
If the index of the password is greater than -1 then one of them are in the password.

-
sirricealot
- Posts: 841
- Joined: Sat Feb 19, 2011 3:35 pm
Need help w/ java class
int foundSymbol = password.indexOf("!@#$%^\&*");Waffles;296974 wrote:If the index of the password is greater than -1 then one of them are in the password.
if(foundSymbol >=0)
So that should work for any symbol?
2006 Chevy Cobalt SS/NA 2.4L IL: FEERME7
2010 Kawasaki Ninja 250r IL: RUNYON
xbxlive: sirricealot07
ps3: sirricealot7
David Runyon
2010 Kawasaki Ninja 250r IL: RUNYON
xbxlive: sirricealot07
ps3: sirricealot7
David Runyon