String str="This is interesting";
How can I find the length of the string ?
Conditions:
1) Not to use any String methods
String str="This is interesting";
How can I find the length of the string ?
Conditions:
1) Not to use any String methods
If you can't use any String methods to find the length of the String, you can use reflection (Hint: String#length returns the field count). However, seeing as this is homework, I think you may have misunderstood the question you're being asked.