Operator Overloading

C++ allows you to define functions for operators, this is called operator overloading. Now why would you need to do that? Well, consider the Circle class we defined earlier. Let’s say I needed to compare two circles to see which one was larger, normally I’d write something like: The problem is, C++ has know way…

Intro to Java Classes – Getters, Setters, and other Methods

In our previous example, we had a class with a default constructor where we passed no arguments into the class. That is great, unless you want to set one or more class variables with data at run time. So lets look at overloading the class constructor. In this example, we keep our default constructor, but…