The C# 'using' statement (not the C# 'using' directive) is syntactic sugar for a try/finally block which disposes an object. Java 7 introduces the 'try with resources' statement:
using (Foo f = new Foo())
Java 7 or higher:
try (Foo f = new Foo())
Foo f = new Foo();
Use C# to Java Converter to convert from C# to Java.
Java and C# Equivalents
Copyright © 1997 – 2017 Tangible Software Solutions Inc.