• Saves Valuable Time
  • Trusted Accuracy since 2004
  • 15-Day Money-Back Guarantee

VB Equivalent to Java 'try with resources'

The Java 7 'try with resources' statement is a shortcut for a try/finally block which closes an object of type java.io.Closeable. The VB equivalent is the 'Using' statement, which operates on objects of type System.IDisposable:

Java VB
try (Foo f = new Foo())
Using f As New Foo()
End Using

Use Java to VB Converter to convert from Java to VB.     

Additional resource: VB.NET and Java Equivalents

Copyright © 2004 – 2021 Tangible Software Solutions, Inc.