3 ms·
This isn't correct, is it? Because the Java platform does not have a common interface to specify disposable objects, the Stab compiler uses the stab.lan
by RyanZAG 14y ago
This isn't correct, is it?
Because the Java platform does not have a common interface
to specify disposable objects, the Stab compiler uses the
stab.lang.Dispose annotation to find the method to call to
dispose the instances of a given type.
Java has Closeable to specify this.
http://docs.oracle.com/javase/1.5.0/docs/api/java/io/Closeable.html http://docs.oracle.com/javase/1.5.0/docs/api/java/io/Closeab...
- callmevlad 14y agoNotice that Closable is in the IO namespace. I think the author is saying there is no equivalent to the .Net System.IDisposable, which can be applied to any object. Edit: See http://stackoverflow.com/questions/1165428/should-closeable-be-used-as-the-java-equivalent-for-nets-idisposable http://stackoverflow.com/questions/1165428/should-closeable-...
- paul_odin 14y agoJava 7 adds java.lang.AutoCloseable (together with try-with-resources) which is essentially the same thing. http://docs.oracle.com/javase/7/docs/api/java/lang/AutoCloseable.html http://docs.oracle.com/javase/7/docs/api/java/lang/AutoClose...