Question: import java.util.Scanner; import java.util.Arrays; public class Main { / * * The 2 - dim return array array should have three rows. The first row
import java.util.Scanner;
import java.util.Arrays;
public class Main
The dim return array array should have three rows.
The first row should contain the zero integers from the input array.
The second row should contain the negative integers from the input array.
The third row should contain the positive integers from the input array.
The entries in each row should be in the same order that they were in in the input array,
Any one of the three rows could be an empty array even all three of them
Use an enhanced forloop whenever possible.
public static int splitint array
This is just the "array of rows". You still need
to create the three rows after you know how big
each row needs to be
int result new int;
return result;
Do not modify this main method.
public static void mainString args
final Scanner in new ScannerSystemin;
final int size innextInt;
final int array new intsize;
for int i ; i array.length; i
arrayi innextInt;
System.out.printlnArraystoStringarray;
System.out.println;
final int splitArray splitarray;
System.out.printlnArraysdeepToStringsplitArray;
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
