• Saves Valuable Time
  • Trusted Accuracy for 12 Years
  • 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())
{
    f.method();
}
Using f As New Foo()
    f.method()
End Using


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

Additional resource: VB.NET and Java Equivalents


Copyright © 1997 – 2017 Tangible Software Solutions Inc.