Question: Write a test java program which prompts a user to enter the size of two arrays as well as to fill their elements. After that,
Write a test java program which prompts a user to enter the size of two arrays as well as to fill their elements. After that, the program checks the same contents of the elements of the two arrays. If these arrays are equal, the program displays message which is "The two arrays are identical". If not equal, displaying "The two arrays are not identical". Write an equals method that reads two arrays and displays these messages above.
Here are the sample runs. How many elements (the size) in the first array: 6 Enter the elements of the first array: 6 1 6 5 2 5 How many elements (the size) in the second array: 6 Enter the elements of the second array: 6 6 1 5 2 5 The two arrays are identical arrays How many elements (the size) in the first array: 6 Enter the elements of the first array: 6 6 6 5 2 5 How many elements (the size) in the second array: 6 Enter the elements of the second array: 6 6 1 5 2 5 The two arrays are not identical arrays How many elements (the size) in the first array: 6 Enter the elements of the first array: 6 1 6 5 2 5 How many elements (the size) in the second array: 5 Enter the elements of the second array: 6 1 6 5 2 The size of the two arrays are not equals
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
