MSIR.0808 New must be disallowed in Public block to be a Private constructor: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Created page with "A <tt>New</tt> constructor was declared in a <tt>Private</tt> block but <tt>New</tt> had not been disallowed in the <tt>Public</tt> block. If the intent is to really have a priva...")
 
m (1 revision)
(No difference)

Revision as of 16:45, 9 November 2010

A New constructor was declared in a Private block but New had not been disallowed in the Public block. If the intent is to really have a private New constructor, specify a Disallow New in the Public block to let users of the class know that the new constructor is not available outside the class. If the Disallow New is already in the Public block, make sure the Public block is declared before the Private. If the intent is not to have a private New constructor, the constructor declaration should be moved to the Public block.