What does assert do?

Posted by peiska on Stack Overflow See other posts from Stack Overflow or by peiska
Published on 2010-06-10T21:31:10Z Indexed on 2010/06/10 21:42 UTC
Read the original article Hit count: 217

Filed under:

What does assert do? for example in the function?

private static int charAt(String s, int d) { 

    assert d >= 0 && d <= s.length();

    if (d == s.length()) return -1;

    return s.charAt(d);
}

© Stack Overflow or respective owner

Related posts about java