1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Sunny_sXe [5.5K]
3 years ago
14

Pass the two arrays to a method that will display the integer value(s), if any, that appear in both arrays (note that the two ar

rays can have no stored values in common). Save the file as ArrayMethodDemo.java.
Computers and Technology
1 answer:
vampirchik [111]3 years ago
5 0

Answer:

The solution code is written in Java

  1.    public static void checkCommonValues(int arr1[], int arr2[]){
  2.        if(arr1.length < arr2.length){
  3.            for(int i = 0; i < arr1.length; i++){
  4.                for(int j = 0; j < arr2.length; j++){
  5.                    if(arr1[i] == arr2[j]){
  6.                        System.out.print(arr1[i] + " ");
  7.                    }
  8.                }
  9.            }
  10.        }
  11.        else{
  12.            for(int i = 0; i < arr2.length; i++){
  13.                for(int j = 0; j < arr1.length; j++){
  14.                    if(arr2[i] == arr1[j]){
  15.                        System.out.print(arr2[i] + " ");
  16.                    }
  17.                }
  18.            }
  19.        }
  20.    }

Explanation:

The key idea of this method is to repeated get a value from the shorter array to check against the all the values from a longer array. If any comparison result in True, the program shall display the integer.

Based on this idea, an if-else condition is defined (Line 2). Outer loop will traverse through the shorter array (Line 3, 12) and the inner loop will traverse the longer array (Line 4, 13). Within the inner loop, there is another if condition to check if the current value is equal to any value in the longer array, if so, print the common value (Line 5-7, 14-16).

You might be interested in
Why is making a model, or prototype, important in the design process?
seropon [69]

Explanation:

to size up and define your works organize and having a creative thoughts and imaginations in it to properly execute the measurement of the clothes.

8 0
3 years ago
Two different applications that make use of the barcode
jeyben [28]
Library books and items bought in stores are 2 different applications that make use of barcodes.
8 0
3 years ago
Summarize why understanding the differences between surface culture and deep culture may inform your knowledge, skills, and prof
lorasvet [3.4K]

Answer: By understanding the basic cultural values of the individual such as looks and talk. Also understanding the core values of the individual such as attitude, beliefs and religion. It would improve the behavior in your professional and cultural relationship with individuals in your workplace.

Explanation:

8 0
2 years ago
Password cracking is a technique used to extract user’s password of application/files without the knowledge of the legitimate us
Vlada [557]

Answer:

Rule based Attack.

Explanation:

                    As password cracking is a technique used to extract user’s password of application/files without the knowledge of the legitimate user. The attacker can use Rule Based Attack to find the password and to intrude or compromise the network and systems.

                    This is like a programming language to generate the password. This involves functions to modify, cut, edit and extend the generally used terms by the user.

5 0
3 years ago
A computer can manipulate symbols as if it understands the symbols and is reasoning with them, but in fact it is just following
Law Incorporation [45]

Answer:

The symbols may or may not have meaning, but the machine does not need to know how the symbols are interpreted in order to manipulate the symbols in the right way.

Explanation:

The computer can change the symbols in the case when the computer understand but in actual following the cut-paste rules without having any understanding this is because the symbols might be have meaning or not but if we talk about the machine so actually they dont know how the symbols are interpreted and how it can be used so that it can be change in the accurate way

5 0
2 years ago
Other questions:
  • While trying to solve a network issue, a technician made multiple changes to the current router configuration file. The changes
    7·1 answer
  • Nadia would like to find text in her current document that differentiates CompanyABC from companyabc. Which option should she us
    8·2 answers
  • How many total channels are available in the United States for wireless LAN use in the unlicensed 2.4ghz ism band ?
    6·1 answer
  • Your computer is configured to obtain an ipv4 address and dns server address automatically. what utility will help you to find t
    7·1 answer
  • Which cisco ios command is used to display the current ospf neighbors and their rids?
    11·1 answer
  • Blank is a type of drag and drop code to help beginner
    14·1 answer
  • Which of the following website is arguably considered the best site to search for scholarships
    8·2 answers
  • What type of waves in the electromagnetic spectrum has the Search for Extraterrestrial Intelligence (SETI) mostly analyzed in th
    15·1 answer
  • The maximum number of characters that a cell can contain is
    11·2 answers
  • You want a cable that could be used as a bus segment for your office network. The cable should also be able to support up to 100
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!