i m working on midp 1.0 and cldc 1.0 it gives a problem when ever i try to build with finalize() in my program :-
"ERROR: finalize methods should not appear Error preverifying class BarBall.MainMenu com.sun.kvem.ktools.ExecutionException: Preverifier returned 1 Build failed"
You actually should avoid creating finalize methods in all of Java. You just never know when it will run, or in some cases it might have already run and will not run when it is actually garbaged.
There are many better solutions for any need to code in the finalize method.
CLDC libraries do not include the method Object.finalize(), and therefore a JVM supporting CLDC shall not support finalization of class instances (JLS sec 12.6). No application built on top of a JVM supporting CLDC shall require tha tifnalization is available.