Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 6
    || is short circuiting. If j == len is evaluated to true, c[j] != c[start] is not evaluated because true || whatever = true. Commented Feb 24, 2014 at 6:50
  • so only if j == len is false, then c[j] != c[start] will be evaluated? thanks @ZouZou Commented Feb 24, 2014 at 6:53
  • 1
    Google lazy evaluation. Commented Feb 24, 2014 at 6:53
  • @Zihan Yes. For more informations, you can also consult the JLS: docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.24. Commented Feb 24, 2014 at 6:55