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
Vesna [10]
3 years ago
8

JAVA

Computers and Technology
1 answer:
ella [17]3 years ago
5 0

Answer:

Explanation:

The following code is written in Java. It creates a function that takes in an ArrayList and an int parameter. Then it loops through the array and adds each element into a new array called newList but adds them the number of times that the numRepeats argument states. Output can be seen in the attached image below.

import java.util.ArrayList;

class Brainly{

   public static void main(String[] args) {

       ArrayList list = new ArrayList();

       list.add('a');

       list.add('b');

       list.add('c');

       ArrayList newList = repeatArrayList(list, 3);

       System.out.println(newList);

   }

   public static ArrayList repeatArrayList(ArrayList list, int numRepeats) {

       ArrayList newList = new ArrayList();

       for (int x = 0; x < numRepeats; x++) {

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

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

           }

       }

       return newList;

   }

}

You might be interested in
If a programming language does not use short-circuit evaluation, what is the output of the following code fragment if the value
miss Akunina [59]

Answer:

Run time error, no output. If myInt = 0 and other is 3, then 3%0 will never occur...apart from that, myInt was neither declared nor initialized

Explanation:

8 0
3 years ago
What might the purpose be for a sata-style power connector on a motherboard?
kozerog [31]
To power a storage device (HDD, SSD)
4 0
3 years ago
Professional communication must be objective,
sveticcg [70]
It’s between technical and rational
3 0
3 years ago
Making each password unrelated to the previous password provides an additional level of security through _____.
Novosadov [1.4K]
B is the only obvious answer.
6 0
3 years ago
In a virtual memory system, each process must have its own page table.(True or False?)
Anna71 [15]

Answer: True

Explanation:

 Virtual memory is the secondary storage memory and this type of memory are addressed as main part of the memory.

When the virtual memory copying in the physical memory then, at that time the operating system divide the memory into the file page with the address and definite size number. Then, the each page are store in a disk.

When this page are required then, the operating system copy from disk to main memory and then, the virtual address are converted into the  real address.

6 0
3 years ago
Other questions:
  • Subnetting is accomplished by borrowing bits from the _____ portion of an ip address and reassigning those bits for use as netwo
    13·1 answer
  • Please Help Fast!!!!!! Brainliest for First to answer!!! Conflict resolution is the process of solving disputes and disagreement
    5·1 answer
  • Add three methods to the Student class that compare twoStudent objects. One method should test for equality. A second method sho
    13·1 answer
  • Sukhi needs to insert a container into her form to collect a particular type of information. Which object should she insert?
    6·1 answer
  • Which of the following is a scam in which a perpetrator sends an official looking e-mail that attempts to obtain a user’s person
    7·2 answers
  • PLEASE HELP!!! WILLGIVE BRAINLIEST!!!
    11·2 answers
  • How to post a answer
    7·1 answer
  • You have just purchased a new Dell PowerEdge R820 Rack Server. The server is equipped with four Xeon E5-4650 CPUs, 128 GB of RAM
    8·1 answer
  • OSI layer for HDLC??​
    13·1 answer
  • jelaskan tiga kemungkinan sebab pengasah pensil itu tidak dapat berfungsi secara tiba-tiba (translate: explain three possible re
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!