Operator Overloading example 2 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Operator Overloading example 2

In the example there is in the declaration of Height and Width in the Box class also a get and set in brackets. I wonder why? I removed them and no difference when running the program. Can someone explain how they are supposed to work?

1st Nov 2020, 5:46 PM
Peter Ekberg
Peter Ekberg - avatar
1 Answer
+ 1
You shloud tag the language also. You started c# so hoping you mean in c#, then read about " properties lesson" to understand that. And check by changing public to private for those variables there then you can see difference..
1st Nov 2020, 8:34 PM
Jayakrishna 🇮🇳