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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 16:30, 19thomasar
How to do this programming flowchart?
Answers: 3
image
Computers and Technology, 24.06.2019 06:30, toolazytobehuman
Me and category do i put them in because this is science
Answers: 1
image
Computers and Technology, 24.06.2019 14:00, makaylahunt
Text or graphics that print at the bottom of every page are called footings footers headers headings
Answers: 1
image
Computers and Technology, 25.06.2019 08:00, india73
When date is processed into a meaningful form, i becomes
Answers: 1
You know the right answer?
Consider the following method: public static String joinTogether(int num, String[] arr)
{

Questions in other subjects: