โ Back to Methods
Question 355
Boolean isPositive Method
Boolean isPositive Method
Write a methodisPositive(int n)that returnstruewhennis greater than 0 andfalseotherwise. Call it with5and print the result: true UseSystem.out.println.
Expected Output:
true
Topics:
Methods
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (sysout, psvm, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.