reference to this

{ Matrix temp=new Matrix;this=temp; (It is not allowed)return true;}this function is in Matrix classis there any way to do this?I want to change where point these object to temp. Thanks
[255 byte] By [metdosa] at [2007-11-26 12:20:17]
# 1
> is there any way to do this?No
aniseeda at 2007-7-7 15:10:08 > top of Java-index,Archived Forums,Socket Programming...
# 2
> is there any way to do this?There is no way to do this. You cannot assign to the this object
tjacobs01a at 2007-7-7 15:10:08 > top of Java-index,Archived Forums,Socket Programming...
# 3
y dont u return the object that you want to reference now instead of true and where you create the actual object this set that varialbe equal to what you return.
alien08o8a at 2007-7-7 15:10:08 > top of Java-index,Archived Forums,Socket Programming...
# 4

Instead of trying to reassign "this", just reinitialize all of the variables (i.e., do whatever the Matrix constructor does). You probably want an "initialize" method that both the constructor and this "reinitialize" method can call. That way, you won't duplicate code (or, at least, not have to duplicate as much code).

doremifasollatidoa at 2007-7-7 15:10:09 > top of Java-index,Archived Forums,Socket Programming...