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.
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.
Chapter8: Arrays
Section: Chapter Questions
Problem 19RQ
Related questions
Question
![Q3:
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}
n-](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fb2eeee36-82c8-4054-a200-adb39d7147e8%2F1b122a86-fb3d-42a6-9a2e-08e1389a5d13%2Fi1fdzr5_processed.jpeg&w=3840&q=75)
Transcribed Image Text:Q3:
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}
n-
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
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.Recommended textbooks for you
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage