About Question enthuware.ocajp.i.v7.2.1063 :
Moderator: admin
-
- Posts: 2
- Joined: Mon Mar 07, 2016 4:55 am
- Contact:
About Question enthuware.ocajp.i.v7.2.1063 :
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
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
-
- Site Admin
- Posts: 10065
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1063 :
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.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 2
- Joined: Mon Mar 07, 2016 4:55 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1063 :
Thanks for the quick answer. That was not so clear for me when I made the test. Now its clear.
-
- Posts: 3
- Joined: Fri Sep 09, 2016 10:57 pm
- Contact:
-
- Posts: 8
- Joined: Tue Nov 07, 2017 8:23 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1063 :
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
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
-
- Site Admin
- Posts: 10065
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1063 :
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.
-
- Posts: 18
- Joined: Thu May 23, 2019 11:58 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1063 :
Importing com package (import com.*;) isn't going to import all the subpackages? Or should I specify it explicitly?
Best regards.
Hamza
Best regards.
Hamza
-
- Site Admin
- Posts: 10065
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1063 :
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.
Who is online
Users browsing this forum: No registered users and 126 guests