Understanding JDK 7 - try-with-resources
===

I am a .net developer. Recently, I picked up interest in comparing java and c#. I found Java's try-with-resources equivalent of C#'s using block. But, I could not understood it completely. I know that C#'s using block is a language feature and compiler generates code for it. I want to gain more understanding about try-with-resources and have few questions on it:

 1. Is it a langauge feature similar to C#'s using block?

 2. What is the equivalent JDK 6 code for the following:

	try(SomeResource resource = new SomeResource())
	{
		//Some logic
	}

 3. What is the equivalent JDK 6 code for the following:

	try(SomeResource resource = new SomeResource())
	{
		//Some logic
	}
	catch(SomeException ex)
	{
	}

 4. What is Java equivalent of C#'s Reflector or ILSpy tool?

Thanks.




    


