Piyush Jain wrote:According to Kathy S and Bert B book java will treat assert as a legal identifier if the assertion is not turned on.
now in the exam if its asked about whether assert is a keyword or used assert as an identifier. What the answer should be, if they don't say anything about turning on the assertion.
Before 1.4 version or lower version like 1.3 or 1.2 versions assert is treated as a identifier
In 1.4 version assert is a keyword
so use lower versions to compile the keyword
you can't compile 1..4 or above version assert is a identifier it gives compile time error
public static void main(String args)
compile javac -source 1.3 Test.java
it shows some warnings but it works
run it java Test
i hope you understand it