in java please
4. Write a static method named longestsortedSequence that accepts an array of integers as a parameter and that returns the length of the longest sorted (nondecreasing) sequence of integers in the array. For example, if a variable named array stores the following values: int [ ] array = {3, 8, 10, 1, 9, 14, -3, 0, 14, 207, 56, 98, 12); then the call oflongestSortedsequence (array) should return 4. Sample Output > run MyArray2
OR
OR