4.1Create a package com.gpm.complex. Create an interface
Complex in it with following member methods: realPart(),
imgPart(), magnitude() and argument() along with default
methods plus(), minus(), into() and divideBy() having
appropriate parameters and return types.
4.2 In the same package create class CartesianComplex with
real and img and class PolarComplex with r and theta as
their member fields. Make the classes implement the
Complex interface. Override all non-default methods in the
interface. Also override toString().
4.3 Now in main(), create one objects of both the classes
defined in 4.2 and print their addition and multiplication
Answers
Answered by
0
Explanation:
ohfxhofhizgilhckgxxgzgkkgzgzifjzzfjc,jjc,ck,kc,kc,zkvkzggx
Similar questions