Question: USING Java Ex 1: Create a class and call it ArrayMethods, and create each one of the following methods and test it in the main.

USING Java

Ex 1: Create a class and call it ArrayMethods, and create each one of the following methods and test it in the main.

1. Method equal(int a[ ], int b[ ]) which receives two integer arrays and returns true if they have the same elements in the same positions, otherwise it returns false;

2. Method sameElements(int a[ ],int b[ ]) which receives two arrays of integers and returns true if the two arrays has the same elements regardless of their positions, for example if a=[2,5,6,1] and b=[1,5,2,6], the method will return true.

3. Method removeDuplicate(int x[ ]) which receives any array of integers, and returns an array that contains the same elements of x without duplicate, for example if x=[2,1,7,2,1] the method will return [2,1,7].

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!