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

后端 未结 12 1406
温柔的废话
温柔的废话 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:27

    If we get BGGA closures in Java, this would also open up for similar structures in Java. Gafter has used this example in his slides, for example:

    withLock(lock) { //closure }
    

提交回复
热议问题