Question: Write a Java program: a . Write a main program - i . That read four integers from input and stored into the array ToModify.
Write a Java program:
a Write a main program
i That read four integers from input and stored into the array ToModify.
ii Then, call printM with the array parameter to print the original array.
iii. After that, call swapM with the array parameter to print the modified array.
iv At last, call printM to print the modified array.
b Define a method print with the array parameter, that print the original array.
c Write a static method swapM that takes an integer array parameter and swaps the first element
with the second element of the array.
d Ex: If the input is:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
