import java.util.Arrays;

public class FilterOddNumbers {
public static void main(String[] args) {
int[] numbers = {1, 2, 3, 4, 5, 6, 7, 8, 9};




    int[] oddNumbers = Arrays.stream(numbers)
                               .filter(n -> n % 2 != 0)
                               .toArray();

    System.out.println("Odd numbers: " + Arrays.toString(oddNumbers));
}
}

optimise this code