Ask your own question, for FREE!
Computer Science 20 Online
OpenStudy (anonymous):

Java question Having trouble implementing a method that takes a parameter and returns the sum of the current object and parameter. How do I do this?

OpenStudy (rsmith6559):

public int addParameter( int x ) { return( this.objectsValue + x ); }

OpenStudy (anonymous):

how would I apply this to a method that takes in a complexnumber and returns a current object plus the parameter.

OpenStudy (anonymous):

the sum of the current object and parameter equals the complex number

OpenStudy (anonymous):

can u send me a resource online on this

OpenStudy (rsmith6559):

I'm sorry, I don't know complex numbers from my elbow. It's doubtful that the entire object is a value. The reason I say that is that objects are usually made of parameters and methods, so I expect that IN the object is the value that will be added to the parameter. Quite possibly, this is done by one, or several (overloaded), of the object's methods.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!