D I really hopes this helps
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;
}
}
The answer & explanation for this question is given in the attachment below.
Answer:
See explaination for program code
Explanation:
code below
using System;
using System.IO;
namespace ReadAndDisplayFileCOnsole
{
class Program
{
static void Main(string[] args)
{
using (StreamReader reader = new StreamReader("D:\\datafile.txt"))
{
while (true)
{
string line = reader.ReadLine();
if (line == null)
{
break;
}
Console.WriteLine(line);
}
reader.Close();
Console.Read();
}
}
}
}
D) Address Block i believe