suppose the following declaration: int arr1[] = new int[10]; int arr2|] = new int [5]; Write a method that create new array arr3 which contain elements that found in array arr1 and found in arr2. Example : arr1={1,2,3,4} arr2={2,4,6,7} arr3={2,4}

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 11RQ
icon
Related questions
Question
suppose the following declaration:
int arr1[] = new int[10];
int arr2[] = new int [5];
Write a method that create new array
arr3 which contain elements that found in
array arr1 and found in arr2.
Example :
arr1={1,2,3,4}
arr2={2,4,6,7}
arr3={2,4}
Transcribed Image Text:suppose the following declaration: int arr1[] = new int[10]; int arr2[] = new int [5]; Write a method that create new array arr3 which contain elements that found in array arr1 and found in arr2. Example : arr1={1,2,3,4} arr2={2,4,6,7} arr3={2,4}
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 3 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT