Zachary Griggs wrote:I compile all my projects in 1.8. Example:
This should work with Java 8. If this is the way your pom is currently setup, then you probably just need to download the SDK.
File -> Project Structure -> Project SDK
If the SDK version isn't compatible with java 1.8, you'll see a lot of errors
You should be able to use Java 1.8 with Amazon Coretto Java 8. That would be a change on the machine to install that SDK and use it, probably. I'd imagine it would be on some sort of build server. Do you use Jenkins?
Junilu Lacar wrote:Line 13 accesses the parameter b directly and since Arrays.sort() does so in place, the array in the calling code will experience the side effect of being sorted after the call is made. That is, if the array b is unsorted before the call to comp(), it will be sorted after. That's kind of a no-no since it's a side-effect that you wouldn't normally expect to happen nor necessarily want to happen.
Junilu Lacar wrote:
Lisa Austin wrote: I was thinking mine maybe better because I'm checking for more than just null arrays?
Your code actually gives incorrect results per this requirement: "If a or b are nil (or null or None), the problem doesn't make sense so return false."
Your code will return true if a and b are null.
Campbell Ritchie wrote:Isn't it a quicksort for an int? In which case wouldn't the memory requirement be the same as that for the original array?
I think trying to find whether two arrays are anagrams of each other can readily be done by sorting. Probably a simpler and therefore less error‑prone solution than some others. What solutions did other people propose themselves?
Stephan van Hulst wrote:
If there already is an entry associated with the given key, merge() will call the remapping function. The remapping function takes two arguments:
The existing value that is associated with the given key. The new value that you passed to the merge() method.
The remapping function must return the value that will be associated with the key after the merge() method returns. You can use this function to quite literally merge the old and the new value.