answersLogoWhite

0


Best Answer

class NumberString

{

private string _value;

private static int getIntValue(string aString) {return int.Parse(aString);}

public static NumberString operator +(NumberString n1, NumberString n2) {

return new NumberString(

getIntValue(n1._value) + getIntValue(n2._value)

);

}

public NumberString(int n) { _value = n.ToString(); }

}

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a simple program of operator overloading IN C SHARP?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you make a constructor overloading programme inc sharp?

By defining multiple constructors that differ in the number or types of arguments.


What is override keyword in c sharp?

Operator Overloading is a Polymorphism concept. Standard unary and binary operators like (+, -, *, /, %, &, |, ) have a predefined implementation that describes their behavior when applied on operands. However using operator overloading we can provide additional meanings to these operators.For example we can add two integers using a + b. However the + operator cannot be used to add two objects for example two vectors. For this we need to overload the operator '+' so as to implement it toadd two vector objects.refer related links for having a look at the example.


Call sharp mobile dialer operator code?

sumontel


How do you program a sharp remote to a sharp tv?

you dont


How do you program a cash register sharp XE A21s?

how to program sharp cash register xe-a21s


When two vessels are operating in the same general are who is responsible for maintaining a sharp lookout?

the operator


How Do you Program a Sharp Aquos remote control to control a Sony tv?

Sharp Aquos is a brand of TV. You can't program it to control another brand of TV.


What POS machine is the easiest to program?

Sharp's ER-A440 is very easy to program.


What is the complete predicate and simple predicate in this sentence Others have sharp teeth?

sharp teeth and teeth


Where are the cyberhome remote codes for sharp ga035sb universal remote?

i need program instructions or sharp ga035sb univer remote


How do you program a sharp aquos remote to control a model sony bdp-bx59 Blu-ray player?

How do you program sharp squid remote to control sony s570 blu ray system


How do you program lodgingstar remote control?

I need the code to tv sharp