final is a keyword that sets a variable's definition to say the variable's value can not be changed.
final int notToBeChanged = 123;
Type: Posts; User: Norm
final is a keyword that sets a variable's definition to say the variable's value can not be changed.
final int notToBeChanged = 123;
The class is not correct yet. The variables: re and im need to be final so that their values can not be changed.
The conversion to an immutable (unchangeable) class is a good start.
The next step would be to make re and im final so that their values can not be changed after being set in the constructor.
Then...
Can you post the new code that shows the changes you made?
Also copy the contents of the console from when you execute the program and paste it here.
A suggestion: Make the class immutable. ...
Please don't post images. The posted image is too small to read and text can not be copied from an image for including in a response.
What is the results after you corrected the problem that Jim...
Can you copy the contents of the console from the program's execution and paste it here?
Add some comments saying what is wrong and show what the desired output is.