java - Assigning value of an object to another - they mustn't point
same adresses at memory -
Get link
Facebook
X
Pinterest
Email
Other Apps
I have a problem getting a new value of an object. I have such code:
... timeline [] offspringScheduleOne = new timeline [AVAILABLE_CLASSROOMS]; ... offspringScheduleOne [i] = jean .get (geneonindex) .getSchedule () [i]; ...
Scheduling up to that assignment appeals [i] and jean. After GT (GeneOnInX), .getSchedule () [i] indicates same memory address . I want to: offspringScheduleOne [i] should get the value of genes.get (geneOneIndex) .getSchedule () [i] , they will not be identical, They should have the same value .
TimeSchedleue class:
Expands the public class time-scheduling algorithm parameter {public int [] [] timetable = new int [day] [hours]; // day and HOS are the final variables obtained from algorithm parameters [] [] getTimetable () {return timetable; } Public Zero Sitemet (Ent [] [] Timetable) {this.timetable = timetable; }}
How can I do this?
This is actually copying value - but you understand it What would that value be?
Comments
Post a Comment