• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Confused about "assert"

 
P Ventura
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't understand if assert is always a keyword and it can't be used as identifier,
vs
assert is a keyword, only if compiling with assertion enabled.
 
Mary John
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess assertion enabling and assertion disable (-ea and -da) is only when executing. ie with java command and not javac compiler options.

checking whether assert has been used as a keyword or as a identifier comes into picture when you compile with javac, and when you use the -source options.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic