Subclassing and operator overloading
I'm giving a small presentation on C++ to several Java people. One enthusiast I know will be attending hates C++ for all he's worth. I got in to an argument before with him about operator overloading and it's uses. I gave as an example, overloading the assignment operator can make copying instances of classes a lot easier in outside code. He argued that you would only have to subclass it in order to copy it. It's my understanding that subclassing (i think he means inheritence) will only create a new class, not a new instance of a class. Is his argument valid? The only way of copying an instance of a class (that I'm aware of) is to make a function to copy each element; add a little and you get operator overloading. One other argument I wanted to bring up at the presentation was that Java already has operator overloading, but you can't use it. (example of strings: "one " + "two "; ).