c# object instantiation

Posted by user1112111 on Stack Overflow See other posts from Stack Overflow or by user1112111
Published on 2010-04-28T11:56:47Z Indexed on 2010/04/28 12:03 UTC
Read the original article Hit count: 295

Filed under:
|

What's the difference between:

Object o = new Object();
o.foo();

and

new Object().foo();

(assuming I do not need the reference afterwards) ?

Are there any reasons for using one instead of the other one (e.g. memory usage) ?

© Stack Overflow or respective owner

Related posts about c#

Related posts about objects