Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is Java but I do not undrestand how the program works. ESPECIALLY the bottom part for Public String and private doubles. Also, why do
This is Java but I do not undrestand how the program works. ESPECIALLY the bottom part for Public String and private doubles. Also, why do we need the letter "o"? I don't understand. Please if you could explain the code in it's entirety but put extra emphasis on the bottom. Thank you.
'Apples.java *Tuna.java In Main.java X 2 public class Main l 3 public static void main (String[] args) 6 7 Complex a = new Complex (2.0, 3. O) ; Complex b new Complex (1.0, 2.0); System. out.println(a + "+tb+"-" + a.add (b) ); 10 12 13 14 15e 16 class Complex public Complex (double real, double imag) this.real- real; this. imag = imag; 18 19 20 21 public Complex add (Complex o #23 24 25 2 6 return new Complex (real t o.real, imag + o.imag); public String tostring) 28 29 30 31 32 return "(" + real + (imag 0.0 ? " - " : " + '') + (imag Main (1) [Java Application] C\Program FilesJava (2.0 + 3.01) + (1.0 + 2.01) 9.0.4 bin exe (Feb 21, 2018, 4:23:56 P (3.0 + 5.01) =Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started