subject

JAVA

Write a method that takes 2 parameters: a String[] array, and an int numRepeats representing the number of times to repeat each element in the array.

Return a new array with each element repeated numRepeats times.

For example:

repeatElements(new String[]{"hello", "world"}, 3)
Should return a new array with the elements:

["hello", "hello", "hello", "world", "world", "world"]

public String[] repeatElements(String[] array, int numRepeats)
{
}

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 07:30, tinasidell1972
An endless cycle of creation and response on the internet is called
Answers: 1
image
Computers and Technology, 23.06.2019 00:00, puppylove899
Which is the correct sequence of steps to set up a document in landscape orientation? a. select page setup from the file menu. then click the margins tab and select landscape. b. select page setup from the edit menu. then click the margins tab and select landscape. c. select page setup from the insert menu. then click the margins tab and select landscape. d. select page setup from the format menu. then click the margins tab and select landscape
Answers: 1
image
Computers and Technology, 23.06.2019 09:30, rscvsdfsrysas3712
Why is an outfitting a workspace with video games in a technology development company considered a strategic use of money
Answers: 1
image
Computers and Technology, 23.06.2019 13:30, alannaamarriee
Jace needs to answer a question on square roots to win a quiz. how can he use a spreadsheet to find the square root of 786? a. use the functions round and count b. create a table and chart c. use the function sqrt d. use the function now
Answers: 3
You know the right answer?
JAVA

Write a method that takes 2 parameters: a String[] array, and an int numRepeats rep...

Questions in other subjects: