If I want to make a simple password checker in java and lets say I have a string and I want to count the characters in it, then make sure that it is above six, what would I do?
Your can call length() method on String object. It returns length of that string.
length()
String
if (str.length() <= 6) //or < 7 //do something else //do something
You can not explicitly set character limit in String object.
1.4m articles
1.4m replys
5 comments
57.0k users