You are not using the using
statement correctly, what you want is as follows:
using(hello ok = new hello())
{
hello no = new hello();
if( ok == no )//Point 1
{
ok = no;//Point 2
}
}//Point 3
Some points (as found in comments above):
This will never be true, because you have two difference instances. Unless, the class has overridden the equality operator
This is not valid and will not compile, you cannot re-assign a variable used in a using
statement
Here ok
will go out of scope, it will also be disposed at this point, assuming it implements IDisposible - I think that it will not compile if it doesn't implement IDisposable anyway
Overall, what you are seemingly trying to do doesn't make much sense at all.