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
viktelen [127]
3 years ago
6

Write a method manyStrings that takes an ArrayList of Strings and an integer n as parameters and that replaces every String in t

he original list with n of that String. For example, suppose that an ArrayList called "list" contains the following values:("squid", "octopus")And you make the following call:manyStrings(list, 2);Then list should store the following values after the call:("squid", "squid", "octopus", "octopus")As another example, suppose that list contains the following:("a", "a", "b", "c")and you make the following call:manyStrings(list, 3);Then list should store the following values after the call:("a", "a", "a", "a", "a", "a", "b", "b", "b", "c", "c", "c")You may assume that the ArrayList you are passed contains only Strings and that the integer n is greater than 0.
Computers and Technology
1 answer:
raketka [301]3 years ago
3 0

Answer:

public static ArrayList manyStrings(ArrayList<String> list, int n){

    ArrayList<String> newList = new ArrayList<String>();

    for (int i=0; i<list.size(); i++) {

        for (int j=0; j<n; j++) {

            newList.add(list.get(i));

        }

    }

    return newList;

}

Explanation:

Create a method called manyStrings that takes two parameters, list and n

Create a new ArrayList that will hold new values

Create a nested for loop. The outer loop iterates through the list. The inner loop adds the elements, n of this element, to the newList.

When the loops are done, return the newList

You might be interested in
The Internet Engineering Task Force (IETF) defines the protocols and standards for how the Internet works. The members of the IE
belka [17]

<em>Answer:</em>

<em>A loosely organized collection of citizens and engineers who communicate mostly by email. </em>

Explanation:

6 0
3 years ago
A SOHO's connection to the internet is through an antenna that sends and receives a microwave signal to the ISP's antenna. There
aksik [14]

Answer:

Line of sight wireless

Explanation:

Line of sight wireless are wireless which enable antenna to sends and receives a microwave signal to the ISP's antenna

By standing between the mounted antenna at client building so that the other side of the wireless connection you intend to create can be visible.

Line of Sight wireless also provide electro-magnetic radio waves that tends to be less affected by external forces leading to better connection reliability because all wireless networks excel only with true line of sight that is why it is always advisable that the antennas are mounted above the tree line, to ensure proper connections without obstacles between them since

Line of sight depend on having a clear line of sight between the antenna and the hotspot .

3 0
3 years ago
In 1997, two South Korean manufacturers of semiconductors, LG Semicon and Hyundai Electronics, were accused of selling dynamic r
KatRina [158]

Answer:

<em>d. dumping.</em>

Explanation:

In international trade, dumping is described loosely as <em>selling products on  a foreign market below their manufacturing expenses or selling products on  a foreign market below their ' reasonable ' market value</em>.

It is a form of injury pricing, a difference in cost aimed at harming the competition.

4 0
3 years ago
Can anyone help my please
Makovka662 [10]

order: soil, plant seeds, water, seedling, corn plant

4 0
2 years ago
Read 2 more answers
Cloud offers better protection compare to on premise?​
dangina [55]

Why is cloud better than on-premise? Dubbed better than on-premise due to its flexibility, reliability and security, cloud removes the hassle of maintaining and updating systems, allowing you to invest your time, money and resources into fulfilling your core business strategies.

The security of the cloud vs. on-premises is a key consideration in this debate. Cloud security controls have historically been considered less robust than onprem ones, but cloud computing is no longer a new technology. . A company running its own on-premises servers retains more complete control over security.

Believe it!!

Pls follow me.

6 0
3 years ago
Other questions:
  • A private local network, accessible only to an organization's staff, is known as an:
    12·2 answers
  • True or False: clicking ads and pop-ups like the one below could expose your computer to malware.
    11·2 answers
  • What considerations have to be kept in mind with JPEG
    10·1 answer
  • What is this line of code doing? scanf("%f", &amp;height);
    6·1 answer
  • Describe the best way to deal with a difficult co-worker?
    13·2 answers
  • Given the statement: int list[25]; The index can go from 0 to 25 inclusive withoutgoing beyond the end of the array.true or fals
    14·1 answer
  • Write a function that dynamically allocates an array of integers. The function should accept an integer argument indicating the
    8·1 answer
  • Explain why the operating system hides certain folders ​
    5·1 answer
  • SUB2 WWolfPlays on yt <br><br><br> true or false if false ima cri
    8·2 answers
  • Question 5 of 10
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!