No. Or, more specifically, they are two distinct objects, but both ways of calling the constructor (with or without 'new') are equivalent here.

By on 9/5/2008 5:58 PM ()

No.  Or, more specifically, they are two distinct objects, but both ways of calling the constructor (with or without 'new') are equivalent here.

Thanks. Is there any scenario where both ways aren't equivalent?

By on 9/5/2008 6:14 PM ()

Hi yashez,

  • You must use "new" if the identifier is a type abbreviation, e.g. "new string(...)". This is to avoid ambiguities with existing function names.
  • If you use "new" with a generic type you must give a generic instantiation for that type, e.g. "new Foo<_,_>(...)"

Thanks

Don

By on 9/5/2008 6:21 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper