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
Anarel [89]
3 years ago
9

Write a method that accepts two string arrays and print common values between the two arrays (Perform case sensitive search whil

e finding common values).
Computers and Technology
1 answer:
aksik [14]3 years ago
6 0

Answer:

public class Main

{

public static void main(String[] args) {

 String[] s1 = {"Hi", "there", ",", "this", "is", "Java!"};

 String[] s2 = {".", "hi", "Java!", "this", "it"};

 findCommonValues(s1, s2);

}

public static void findCommonValues(String[] s1, String[] s2){

    for (String x : s1){

        for (String y : s2){

            if(x.equals(y))

                System.out.println(x);

        }

    }

}

}

Explanation:

*The code is in Java.

Create a method named findCommonValues that takes two parameters, s1 and s2

Inside the method:

Create a nested for-each loop. The outer loop iterates through the s1 and inner loop iterates through the s2. Check if a value in s1, x, equals to value in s2, y, using equals() method. If such a value is found, print that value

Inside the main method:

Initialize two string arrays

Call the findCommonValues() method passing those arrays as parameters

You might be interested in
An Inspect and Adapt (I&A) event is occurring and a program is trying to address a long-existing problem (WIP)?"unreliable P
ASHA 777 [7]

The aspect Of the program that causes uncontrollable amounts of work in process is that Teams do not do a good job of task switching.

<h3>What is task switching?</h3>

Task switching or task interleaving is known to often take place if a task is voluntarily or involuntarily stopped so as to listen  to another task.

In the case above, The aspect Of the program that causes uncontrollable amounts of work in process is that Teams do not do a good job of task switching.

Learn more about task switching from

brainly.com/question/12977989

#SPJ1

7 0
2 years ago
A group of N stations share a 56-kbps pure ALOHA channel. Each station outputs a 1000-bit frame on average once every 100 sec, e
Sunny_sXe [5.5K]

Explanation:

Here, in the given statement, maximum flow capacity of the ALOHA channel = 18.4% = 0.184

Then, the stations N share 56 kbps

And, the channel rate = 0.184*56 = 10.304 kbps.  

Then, the outputs of the wach stations is 1000-bit frames/100 sec

\therefore, the output of the bits/ sec by each stations = \frac{1000}{100} bits/sec = 10 bits/sec

So, The output of the N stations is 10 bits/sec on the channel that having 10.304kb/sec

Finally, N = \frac{(10.304 \times 10^{3})}{10} = 1030 stations

3 0
3 years ago
Anthony is deciding between different savings accounts at his bank. He has four options, based on how frequently interest compou
leonid [27]
Depends is the answer multiple choice
7 0
4 years ago
Read 2 more answers
When you reference a cell or range in a different worksheet, the ____ separates the sheet reference from the cell reference.
Lera25 [3.4K]
B.   !  

(e<span>xclamation point is the symbol that </span>separates<span> a </span>worksheet reference<span> from a </span><span>cell reference)</span>
6 0
3 years ago
One of the difficult things about working in game design is that while there are many different roles, most of them only match o
Papessa [141]

Answer:

it's false

Explanation:

they don't match to personalities

6 0
2 years ago
Other questions:
  • Cloud computing service providers manage different computing resources based on the services they offer. Which resources do IaaS
    11·1 answer
  • Oxygen-18 has an atomic number of 8. How many neutrons are in this isotope?
    7·1 answer
  • What does the rule of five say?
    12·2 answers
  • Three variables, x, y and z, supposedly hold strings of digits, suitable for converting to integers. Write code that converts th
    13·2 answers
  • The method needed to arrange for an object to be notified when a window's close-window button has been clicked is
    6·1 answer
  • Seeing an error message on the screen after you click on a link or icon may indicate that your PC doesn't have the correct _____
    15·1 answer
  • Formulas should follow the___
    9·1 answer
  • HELPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP!!!
    12·1 answer
  • Put these numbers in order from smallest to largest:<br> 1. 00101112<br> 2. 011110<br> 3. 011110112
    12·2 answers
  • (1) Experiment Purpose
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!