PRO192_-_SU_2023_-_Block_5_-_FE_735.webp
successful_man

PRO192_-_SU_2023_-_Block_5_-_FE_735.webp

(13)
Answer (Choose 1 answer)
Given:
A. A ParseException is thrown by the foo method at runtime.
B. A NumberFormatException is thrown by the foo method at runtime.
C. 0.0
D. Compilation fails at line 15 with message about variable x not found.
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.}
What is the result?

Thông tin

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

Image metadata

Filename
PRO192_-_SU_2023_-_Block_5_-_FE_735.webp
File size
54.3 KB
Dimensions
1542px x 690px

Share this media

Back
Bên trên Bottom