CrazyEngineers
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Anoop Kumar

    MemberSep 11, 2013

    Assertions are generally part of Unit Testing.
    You are going to test something which are are you expecting.
    Like if you are expecting null then you can assert
    assert i==null : "throw this message"
    Assertions are bydefault disabled so adding assertions will not affect your run time. but when you need it.
    just enable is by sending  jvm parameter -ea.
    
    example :  java -ea <className>
    Good one but very less used. everyone is using IDE with debugger.
    Are you sure? This action cannot be undone.
    Cancel
  • vikaskumar11233

    MemberSep 12, 2013

    Assertion are used to verify the correctness of an invariant in the code. They should never be triggered in production code, and are indicative of a bug or misuse of a code path.
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register