Page 1 of 1

About Question enthuware.ocajp.i.v7.2.1063 :

Posted: Mon Mar 07, 2016 4:59 am
by rekoch
Hi there

I guess there is a small typo in this question. The example ist based on the image above. On the image the class-name is "Stock.class". But in the question itself, there is "class StockQuote".

Best regards
Andreas

Re: About Question enthuware.ocajp.i.v7.2.1063 :

Posted: Mon Mar 07, 2016 10:36 am
by admin
That is because there are two different classes - Stock.class is present in the location given in the picture and StockQuote is yet to be compiled (as per the question) and so is not shown in the the picture.

HTH,
Paul.

Re: About Question enthuware.ocajp.i.v7.2.1063 :

Posted: Mon Mar 07, 2016 12:36 pm
by rekoch
Thanks for the quick answer. That was not so clear for me when I made the test. Now its clear.

Re: About Question enthuware.ocajp.i.v7.2.1063 :

Posted: Sun Sep 11, 2016 1:16 am
by Hissam
MY bad

Re: About Question enthuware.ocajp.i.v7.2.1063 :

Posted: Mon Apr 16, 2018 2:00 pm
by SeoaneR
when I type the method with the throws IOException i get a compilation error stating" cannot find symbol" but as
soon as I type import java.io the compilation error is no longer there.
One of the options given as a potential answer is :
It is not required to import java.io.* or import java.io.IOException because java.io package is imported automatically.
Why do I get a Compilation Error if the above statement says that it is automatically imported

Re: About Question enthuware.ocajp.i.v7.2.1063 :

Posted: Mon Apr 16, 2018 8:27 pm
by admin
That is an incorrect option. You do need import java.io.* or import java.io.IOException if you are using IOException in your code.

Re: About Question enthuware.ocajp.i.v7.2.1063 :

Posted: Sat May 25, 2019 12:08 pm
by hamzaBlm
Importing com package (import com.*;) isn't going to import all the subpackages? Or should I specify it explicitly?

Best regards.
Hamza

Re: About Question enthuware.ocajp.i.v7.2.1063 :

Posted: Sat May 25, 2019 9:21 pm
by admin
hamzaBlm wrote:
Sat May 25, 2019 12:08 pm
Importing com package (import com.*;) isn't going to import all the subpackages? Or should I specify it explicitly?

Best regards.
Hamza
No, please go through a book to read about it before attempting mock exams. Or try this page: https://beginnersbook.com/2013/03/packages-in-java/