Norm Radder wrote:Can you add some comments to the printed output where the output is not what you expected? Also explain why?
there is one less record between both data sets in the output
Clemonte Johnstone wrote:
Norm Radder wrote:Can you add some comments to the printed output where the output is not what you expected? Also explain why?
Hi, if you look carefully you will see that there is one less record between both data sets in the output
Ron McLeod wrote:The element reference provided to the ArrayList#remove method is of type Object, so the Object#equals method will be used to determine equality.
If you want to implement your own overriding equals implementation, the method signature will need to be equals(Object obj), otherwise Object's implementation will invoked.
how does equals even get invoked
Clemonte Johnstone wrote:I am removing the absolute path of the parent directory that contains the files so it has to be the same. I would expect for the directory to be removed?
Norm Radder wrote:Look at what is in the list. Is there a entry for the directory?
Print what is in the List so we can see if there is an entry for the directory.
Do you mean that is what is displayed when you print your List? It isn't a path at all; if you read about Object#toString(), you will find out what it is.Clemonte Johnstone wrote:They are the same i.e. somemadeuppath
Campbell Ritchie wrote:
Do you mean that is what is displayed when you print your List? It isn't a path at all; if you read about Object#toString(), you will find out what it is.Clemonte Johnstone wrote:They are the same i.e. somemadeuppath
* * * * * * * * * * * *
Please don't quote the whole of the preceding post; that adds nothing to the discussion and is liable to removal.
Clemonte Johnstone wrote:Apologies for the delay in response, I have been very busy. I will take another look and get back to you.
Norm Radder wrote:Overriding the toString() method allows the class's author to return a String that describes what is to be shown for an instance of the class. For example when printing.
Norm Radder wrote:Overriding the toString() method allows the class's author to return a String that describes what is to be shown for an instance of the class. For example when printing.
why does the following program print empty ""?
If that's the case then why does the following program print empty ""?
I carry this gun in case a vending machine doesn't give me my fritos. This gun and this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|