It says that importing java.lang.* is correct as it will not cause an error even if it is unnecessary.
However, it also claims that importing java.util.* is incorrect. Does this cause an error? If, not why would one be the correct answer and not the other.
Any clarification is appreciated!
About Question 30 in com.enthuware.jfcja.v8.2.458 :
Moderator: admin
-
- Posts: 1
- Joined: Sun Aug 21, 2022 12:46 pm
- Contact:
-
- Site Admin
- Posts: 9791
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question 30 in com.enthuware.jfcja.v8.2.458 :
It is true that importing the util package will not cause an error but it is a wrong option because this import is not relevant in the given situation. The Math class is in java.lang package, so importing java.lang is ok but importing java.util is not ok (although no compilation error but is logically incorrect).
But I agree with you that this option is not good. Will update the question accordingly.
thank you for your feedback!
But I agree with you that this option is not good. Will update the question accordingly.
thank you for your feedback!
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 1 guest