X42: frontPiece

Given an int array of any length, return a new array of its first 2 elements. If the array is smaller than length 2, use whatever elements are present.

Your Answer:


Practice a different Java exercise


Your feedback will appear here when you check your answer.