X1618: Are all elements positive?

Write the method boolean areAllPositive(int[] nums) in Java that returns true if all elements in the array nums are positive (greater than 0), and returns false otherwise.

Examples:

areAllPositive({10,4,11,50}) -> true
areAllPositive({10,4,-11,50}) -> false

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.