C#C
C#2y ago
10 replies
zxa4fd

Can someone explain why these nested `using` is different from the ordinary one?

How is this:
using(resource1)
using(resource2) 
{
    // Code here
}
different from:
using(resource1) 
{
    using(resource2)
    {
    // Code here
    }
}
Was this page helpful?