Another point observed in the KnB book is that for almost all the examples the authors have used the following code...
Pattern p = Pattern.compile("aba");
Matcher m = p.matcher("ababababababa");
boolean b = false;
while (b = m.find)
{ System.out.print("Answers"); }
Now can anyone please help me out with the value of using the "while (b = m.find)" option?
I find it works the same with out the boolean too "while (m.find)"
Is it actually necessary or am i missing something here?
Thanks