Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Search if an array contains elements from another array

888525Aug 20 2012 — edited Aug 21 2012
I have an array whose length is not know(ARRAY 1)
I have another array whose lenth is known(ARRAY 2)

I have to see if array 1 contains elements from array 2 and then form another array which contains elements which are not present in Array1.
The values I am dealing is int values.ALso I am not sure if i should be using Arrays or some other collection.
I tried to loop through one and compare other but this gives arrayIndexoutOfBound exceptionas the length of array 1 is unknown.
Please suggest how to do this.

Thanks,
This post has been answered by unknown-7404 on Aug 20 2012
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 18 2012
Added on Aug 20 2012
7 comments
1,111 views