Page 1 of 1

About Question 30 in com.enthuware.jfcja.v8.2.458 :

Posted: Sun Oct 09, 2022 11:43 pm
by tntbabin@gmail.com
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!

Re: About Question 30 in com.enthuware.jfcja.v8.2.458 :

Posted: Mon Oct 10, 2022 12:26 am
by admin
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!

Re: About Question 30 in com.enthuware.jfcja.v8.2.458 :

Posted: Fri Apr 07, 2023 7:00 pm
by zak.nk
admin wrote:
Mon Oct 10, 2022 12:26 am
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!
Well, it seems you haven't updated the question... I got this one right by guessing the "most correct" the first time I took it, and wrong today after retaking because I just didn't read after I selected 2 options that definitely met the condition of "what CAN be inserted in lines //1 and //2?"

If the question was at least "should be inserted," it would make you at least check all the answers as it hints at the fact that maybe you shouldn't import an entire package that you are not using at all.

Thanks.

Re: About Question 30 in com.enthuware.jfcja.v8.2.458 :

Posted: Sat Apr 08, 2023 12:45 pm
by admin
Definitely fixed now in v 1.12.
thank you for your feedback!