During your for-loop you are creating new Finalizer-objects and invoking the finalize()-method immediately. Calling the finalize()-method on an object does not mean that the object is destroyed or garbage collected - it's just a "normal" method call.
After the for-loop there are thousands of unused objects in the memory, thus eligible for garbage collection.
With System.gc() you ask the garbage collector to run (and usually it does so). The garbage collector starts to remove unused objects and calls the finalize method (although you cannot absolutely rely on that!).
Every time an object is removed by the garbage collector you get the output "true ###".
Since System.gc() is the last command of the application, the garbage collector cannot remove all objects, i.e. it might not call the finalize method of every object (therefore on shouldn't rely on that method...). In your case it typically removes a few thousands and then the application ends.
NOTE: you only see "true 10000", but in the background thousands of objects are removed! You can test this by just removing the if (x % 10000 == 0) statement in the finalize()-method.