Write (define) a public static method named getAllLessThan, that takes an array of int, and an int as arguments and returns a an int array with all of the values in the argument array that are less than the second argument value. For example, given the following Array declaration and instantiation: int[] myArray = {1, 22, 333, 400, 5005, 9}; getAllLessThan(myArray, 300) will return an Array of int with these values {1, 22, 9} Note that the values in the returned array must be in the same order as they are in the argument array. You may wish to write some additional code to test your method. ------------------------------------------------------------------- public class Main { public static void main(String[] args) { // you may wish to write some code in this main method // to test your method. } }
Write (define) a public static method named getAllLessThan, that takes an array of int, and an int as arguments and returns a an int array with all of the values in the argument array that are less than the second argument value.
For example, given the following Array declaration and instantiation:
int[] myArray = {1, 22, 333, 400, 5005, 9};
getAllLessThan(myArray, 300) will return an Array of int with these values {1, 22, 9}
Note that the values in the returned array must be in the same order as they are in the argument array.
You may wish to write some additional code to test your method.
-------------------------------------------------------------------
public class Main {
public static void main(String[] args) {
// you may wish to write some code in this main method
// to test your method.
}
<your method definition here>
}
![Main.java
Load default template...
1 public class Main {
2
public static void main(String[] args) {
// you may wish to write some code in this main method
// to test your method.
}
3
4
7
<your method definition here>
8
9 }
Run your program as often as you'd like, before submitting for grading. Below, type any
needed input values in the first box, then click Run program and observe the program's
output in the second box.
Develop mode
Submit mode](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F11d04d1b-414c-4e30-b9e8-ca86d6b26e1f%2F9320cc54-bfad-455c-bde4-956281666d52%2F8xqalta_processed.png&w=3840&q=75)

Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images









