PRO192_-_SP_2024_-_RE_1741.webp
Izumi991

PRO192_-_SP_2024_-_RE_1741.webp

  • Media owner Izumi991
  • Ngày thêm
(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.}
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.


Q: 35

Thông tin

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

Image metadata

Filename
PRO192_-_SP_2024_-_RE_1741.webp
File size
210.1 KB
Dimensions
1920px x 892px

Share this media

Back
Bên trên Bottom