Top.Mail.Ru
November 10th, 2005 - Java developers — LiveJournal
? ?

Java developers

November 10th, 2005

11:00 am - vaduha - i += i++ + ++i; VS i++; i += i++ + i;

via http://www.livejournal.com/community/ru_java/150455.html

Can you explain why

int i = 1;
i += i++ + ++i;


is not equivalent to:

int i = 1;
i ++;
i += i++ + i;


UPD: By the way, C++ code (on MS Vstudio 6.0 and g++ under Linux) gives the same result in the both cases - "7".

12:18 pm - ska_o - garbage collector

Hi all,

Is there some key I can press at the command line, while the JVM is running, to force garbage collection? For example, in Windows JVM, Control-Break will produce a thread dump. Is there a keystroke for GC?

Thanks in advance.

PS The short answer to my question seems to be no. I forgot to mention that the garbage collector can be invoked through jconsole in java 5, it just is not always as convenient as a key combination. Anyway, I was trying to find the right place in my code to place the System.gc() call in order to get around some problems, and I found it.
Powered by LiveJournal.com