IK
Answered
How are arrays tested to see if they contain the same contents?
On Jun 06, 2024
The best way to test two arrays to see if the contents are the same is to write a method that accomplishes the task.This method would iterate through each array comparing indexed variables.If arrays are tested for equality using the == operator,you are only testing to see if the arrays reference the same memory location.It is quite common for two arrays to reference different memory locations,but contain the same elements.