PRO192_-_REB5_-_FA_2023_1330.webp
lanhong87

PRO192_-_REB5_-_FA_2023_1330.webp

Answer (Choose 1 answer)
Given:
11. public static void foo(String str) {
12. try {
13. float x = Float.parseFloat(str);
14. } catch (NumberFormatException e) {
15.x = 0;
16. } finally {
17. System.out.println(x);
18. } 19.}
20. public static void main(String[] args) {
21. foo("invalid");22.1
What is the result?
A. 0.0
B. Compilation fails at line 15 with message about variable x not found.
C. A ParseException is thrown by the foo method at runtime.
D. A NumberFormatException is thrown by the foo method at runtime.

Exit 50

Thông tin

Category
PRO192
Thêm bởi
lanhong87
Ngày thêm
Lượt xem
4,677
Lượt bình luận
22
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
PRO192_-_REB5_-_FA_2023_1330.webp
File size
56.8 KB
Dimensions
1542px x 690px

Share this media

Back
Bên trên Bottom