subject

Consider the following method: public static String joinTogether(int num, String[] arr)
{
String result = "";
for (String x : arr)
{
result = result + x. substring(0, num);
}
return result;
}

The following code appears in another method in the same class:
String[] words = {"dragon", "chicken", "gorilla"};
int number = 4;
System. out. println(joinTogether(number, words));

What is printed when the code above is executed?
a. dragonchickengorilla
b. drachigor
c. dragchicgori
d. dragochickgoril
e. There is an error in the program, it does not run


Consider the following method:

public static String joinTogether(int num, String[] arr)
{
String

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 17:00
1. so if i wanted to build a linux server for web services(apache) with 1cpu and 2 gb of memory.-operating at 75% of memory capacity2. a windows server with 2 cpu/ 4gb memory- operating at 85% of memory capacity3. a storage server with 1 cpu/ 2gb memory- operating at 85% of memory capacityhow much memory do i have to add for each server.so that the utilization rate for both cpu and memory is at a baseline of 60%."the details for the cpu like its processor or the memory's speed isnt to be concerned" yeah i kept asking my teacher if he's even sure about the but the whole class seems to be confused and the project is due in 3 days..this is a virtualization project where i have to virtualize a typical server into an exsi hypervisor.
Answers: 2
question
Computers and Technology, 22.06.2019 20:00
What is the worst-case complexity of the maxrepeats function? assume that the longest string in the names array is at most 25 characters wide (i.e., string comparison can be treated as o( class namecounter { private: int* counts; int nc; string* names; int nn; public: namecounter (int ncounts, int nnames); int maxrepeats() const; }; int namecounter: : maxrepeats () { int maxcount = 0; for (int i = 0; i < nc; ++i) { int count = 1; for (int j = i+1; j < nc; ++j) { if (names[i] == names[j]) ++count; } maxcount = max(count, maxcount); } return maxcount; }
Answers: 3
question
Computers and Technology, 23.06.2019 21:30
To move a file or folder in microsoft windows, you can click and hold down the left mouse button while moving your mouse pointer to the location you want the file or folder to be, which is also known as.
Answers: 3
question
Computers and Technology, 23.06.2019 23:30
The keyboard usually has six rows of keys. which of the following is not one of the key group categories? letter keys number keys control keys graphic keys
Answers: 1
You know the right answer?
Consider the following method: public static String joinTogether(int num, String[] arr)
{
Questions
question
Computers and Technology, 21.09.2019 21:20
question
Computers and Technology, 21.09.2019 21:20
question
Mathematics, 21.09.2019 21:20
question
English, 21.09.2019 21:20
Questions on the website: 13722363