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

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
rekoch
Posts: 2
Joined: Mon Mar 07, 2016 4:55 am
Contact:

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

Post 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

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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.
If you like our products and services, please help us by posting your review here.

rekoch
Posts: 2
Joined: Mon Mar 07, 2016 4:55 am
Contact:

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

Post by rekoch »

Thanks for the quick answer. That was not so clear for me when I made the test. Now its clear.

Hissam
Posts: 3
Joined: Fri Sep 09, 2016 10:57 pm
Contact:

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

Post by Hissam »

MY bad

SeoaneR
Posts: 8
Joined: Tue Nov 07, 2017 8:23 am
Contact:

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

Post 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

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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.
If you like our products and services, please help us by posting your review here.

hamzaBlm
Posts: 18
Joined: Thu May 23, 2019 11:58 am
Contact:

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

Post by hamzaBlm »

Importing com package (import com.*;) isn't going to import all the subpackages? Or should I specify it explicitly?

Best regards.
Hamza

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

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

Post 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/
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 32 guests