हिंदी
तमिलनाडु बोर्ड ऑफ सेकेंडरी एज्युकेशनएचएससी विज्ञान कक्षा ११

What are the rules for operator overloading? - Computer Science

Advertisements
Advertisements

प्रश्न

What are the rules for operator overloading?

टिप्पणी लिखिए

उत्तर

Following are some rules to be followed while implementing operator overloading.

  1. The precedence and associativity of an operator cannot be changed.
  2. No new operators can be created, only existing operators can be overloaded.
  3. Cannot redefine the meaning of an operator’s procedure. You cannot change how integers are added. Only additional functions can be to an operator.
  4. Overloaded operators cannot have default arguments.
  5. When binary operators are overloaded, the left-hand object must be an object of the relevant class.
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 15: Polymorphism - Evaluation - Section - D [पृष्ठ २५८]

APPEARS IN

सामाचीर कलवी Computer Science [English] Class 11 TN Board
अध्याय 15 Polymorphism
Evaluation - Section - D | Q 1. | पृष्ठ २५८
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×