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
REY [17]
3 years ago
15

Write a public static method named printArray, that takes two arguments. The first argument is an Array of int and the second ar

gument is a String. The method should print out a list of the values in the array, each separated by the value of the second argument.
Computers and Technology
1 answer:
Serjik [45]3 years ago
5 0

Answer:

Written in Java

public static void printArray(int myarr[], String s){

       for(int i = 0; i<myarr.length;i++){

           System.out.print(myarr[i]+s);

       }

   }

Explanation:

This defines the static method alongside the array and the string variable

public static void printArray(int myarr[], String s){

The following iteration iterates through the elements of the array

       for(int i = 0; i<myarr.length;i++){

This line prints each element of the array followed by the string literal

           System.out.print(myarr[i]+s);

       }

   }

The method can be called from main using:

<em>printArray(myarr,s);</em>

Where myarr and s are local variables of the main

You might be interested in
A medium is a:
Nostrana [21]
C is a medium. And the answer
4 0
3 years ago
Read 2 more answers
The most popular input device of a computer is a(n) ____.
zaharov [31]
A keyboard and a mouse

7 0
3 years ago
The Internet began when a large company wanted to sell products online
aalyn [17]
No!The internet began in the 1950s when the US government was trying to use connected computers to compete with the Soviet Union's Sputnik. Hope this helps :)
6 0
3 years ago
What is the Multiple Source Test
Goshia [24]
A source is where you can look to find info. Multiple means many or some. 

Therefore, a multiple source test is a test that you can find the answers in multiple sources, such as a book, article, journal, etc. 
7 0
3 years ago
Read 2 more answers
One reason to buy a home instead of rent a home is:
vazorg [7]
A is the correct Answer

7 0
3 years ago
Other questions:
  • An operating system cannot run from an external drive. true or false
    15·1 answer
  • Only put coolant into your radiator when the engine is<br> A. on<br> B. hot<br> C. warm<br> D. cool
    6·1 answer
  • to add data to to a chart, you must format data from another microsoft office product, that automatically opens. whats the name
    10·1 answer
  • Should the federal government have bug bounty programs? Why or why not?
    9·2 answers
  • Count the number of words in the string. A word is one or more non-blank characters separated by one or more blanks. My suggesti
    13·1 answer
  • The image below shows a weather service map
    13·1 answer
  • How do i delete an account for brainly how do i delete everything
    7·2 answers
  • In batch operating system three job J1 J2 and J3 are submitted for execution each job involes an I/O activity a CPU time and ano
    13·1 answer
  • Write a program to enter RADIUS of a CIRCLE and PRINT AREA of TRIANGLE using Q Basic. (class 8)​
    9·1 answer
  • Open the NetBeans IDE and create a new project named MySizes.java. Your program should do the following:
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!