> I believe my student discovered a mistake in Java
> num = num++; should (as it does in C++) assign num to num then increment num.
> invokes undefined behaviour.... Ah HA! That sounds like the correct answer. ... depending on the compiler!
From the … Read More
I have sympathy for the student whose teacher doesn't know fundamentals of the language like this... Read More
> It works correctly in C++ but not in Java...
Hopeless, absolutely hopeless. Read More
You are entitled to your opinion, BUT, when the process is EXPLICITLY defined by the JLS to NOT do that, it doesn't really MATTER what your opinion is.
Edit: Also, you STILL do not seem to have grasped the fact that C++ "works" that way IN THE CURRENT IMPLEMENTATION of … Read More
> My interpretation that it should return 1 is a valid one
when we're talking about Java, you (being a Java teacher, or so you claim) you should know perfectly well that it is NOT a valid one. mainly, because that is not how it was implemented … Read More