I was making a project in Greenfoot and I made an imaginary number class. In my project I found a need to add (or subtract, or whatever) two imaginary objects together, is there a way to add two objects like that? So this is how it would look in a perfect world:
Imaginary i1 = new Imaginary(1.7,3.14);
Imaginary i2 = new Imaginary(5.3,9.1);
//the class Imaginary has parameters (double real, double imaginary)
Imaginary i3 = i1+i2;
Is that possible?