← Back to Question List
Java Quiz #10
Sign Method Output
What does this method return when called with getSign(-5)?
📄 Code
1public static int getSign(int num) {2 if (num > 0) {3 return 1;4 } else if (num < 0) {5 return -1;6 } else {7 return 0;8 }9}