|
From: HANISH S. <han...@gm...> - 2021-05-31 22:04:44
|
Hello, Greetings, I have a question regarding the TARGET class. I have created 2 instances of the target class "obj" and "obj2". After this, I added 2 holidays in obj2 instance using addHoliday(). Now, if I print the holidayList of both the instances, I get the same result ie 2 added holidays in the holiday list of obj as well. PFB the code snippet and output: [image: image.png] [image: image.png] Why is the output of obj.holidayList contains the holidays added in obj2 instance? How can I get the holidaylist of obj exclusive to obj ie holidays added in other instances do not become the part obj's holidaylist. Thank you in advance. Regards Hanish Sharma |