subject
Computers and Technology, 04.01.2020 22:31 AdoNice

Ihave to write this in java, but i've never even learned it before and i'm completely lost
start a program in a class named arrayprinter. ignore the main method for a moment.
in your class, create a static method named printarray with one parameter of type int[] named arr. inside this method, do the following.

keep all of your output in this method on one line using system. out. print() until directed to use
display an opening square bracket character.
loop through the array that was passed into the method. display the values in the array. add a comma and a space after every value except the last one.
using system. out. display a closing square bracket character.
in your main method, create the following array. pass the reference to this array to the printarray method, run your program, and verify that it works as expected.

int[] oned = {5, 6, 7, 8};
in your main method, add a blank println() statement after the method call you just made.
in the class, create an overloaded static method named printarray with one parameter of type int[][] named arr. inside this method, do the following:
using display an opening square bracket character.
loop through the two-dimensional array that was passed into the method.
first, use system. out. print() to display two space characters.
every element of this two-dimensional array that you are looping through is a one-dimensional array of int. call the other printarray method and pass to it each one-dimensional array in the two-dimensional array.
using display a closing square bracket character.
in your main method, create the following two-dimensional array. pass the reference to this array to the printarray method, run your program, and verify that it works as expected.
int[][] twod = {{2, 4, 6, 8},
{8, 7, 9, 1},
{3, 5, 1, 2}};
in your main method, add a blank println() statement after the method call you just made.
in your main method, create the following ragged two-dimensional array. pass the reference to this array to the printarray method, run your program, and verify that it works as expected.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:00
Which are examples of note-taking tools? check all that recording devices sticky notes digital highlighters paper flags highlighting pens digital displays digital flags
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
What is the original authority for copyright laws
Answers: 1
question
Computers and Technology, 23.06.2019 17:30
What are the most commonly found items in the trash according to the municipal solid waste report?
Answers: 1
question
Computers and Technology, 24.06.2019 10:00
Which feature of a blog to restore and retrieve older post
Answers: 3
You know the right answer?
Ihave to write this in java, but i've never even learned it before and i'm completely lost
sta...
Questions
question
History, 20.09.2020 03:01
question
Mathematics, 20.09.2020 03:01
question
Mathematics, 20.09.2020 03:01
question
Mathematics, 20.09.2020 03:01
Questions on the website: 13722367