Does java have an equivalent to the C# “using” clause

后端 未结 12 1433
温柔的废话
温柔的废话 2020-12-29 23:09

I\'ve seen reference in some C# posted questions to a \"using\" clause. Does java have the equivalent?

12条回答
  •  太阳男子
    2020-12-29 23:20

    Not that I'm aware of. You can somewhat simulate with a try...finally block, but it's still not quite the same.

提交回复
热议问题