Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Returning an object from a method

User_27ADDFeb 3 2021

Hullo,
I have built a library of Matrix functions and now I want to test those functions. I have built a simple program to do this, and connected the library to this application. In my program I do the following;-
1 Use a Constructor to create the matrix of the correct size and with a value assigned to each location in the array.
2 Use a library method (matMultTD()), to multiply two matrices together and return a Matrix object.
fitLeft = new Matrix(2, 2, 1);
fitLeft.matMultTD(obsLeft, obsLeft);
I have followed the actions in the debugger and the matMultTD method does what is it supposed to do, but obviously the way that I have linked the Matrix output from the matMultTD method does not work because the fitLeft Matrix retains the original values. What am I doing wrong?

Comments

Processing

Post Details

Added on Feb 3 2021
3 comments
106 views