• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java Magazin July/August "Quiz yourself"

 
Ranch Hand
Posts: 57
1
Netbeans IDE Oracle Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,
I just want to inform you that the current issue of the Java Magazine contains a small article with some (4) trick questions for/from 1ZO-808 (OCA Java 8).

You may have to log in to your oracle account to access the content.

Regards,
Bernhard
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bernhard Goetz wrote:I just want to inform you that the current issue of the Java Magazine contains a small article with some (4) trick questions for/from 1ZO-808 (OCA Java 8).


Thanks for sharing. Have a cow!

Bernhard Goetz wrote:You may have to log in to your oracle account to access the content.


I logged in with my Oracle account, but I couldn't access the content. I had to register (for free) for the Java Magazine. After completing the subscription form, I got the following confirmation message

Your digital subscription will begin with our next issue. Java Magazine will contain articles direct from Java engineers at Oracle as well as the Java community at large.

And after subscribing I still can't view the full content of the Java Magazine, when trying to login I get the error message: "We couldn't find your subscription. Please try again.". That makes no sense at all!

Maybe I have to wait for some time (I didn't get a confirmation email of my subscription yet).

Kind regards,
Roel
 
Bernhard Goetz
Ranch Hand
Posts: 57
1
Netbeans IDE Oracle Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hm, that's odd. Even when I click on "Preview Current Issue" I get an error message.

But I can create a link to share with a "friend". So here it is. Maybe this works?
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bernhard Goetz wrote:Maybe this works?


Hmm, at work I was able to have a look at these questions using your link but at home I can't...
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bernhard Goetz wrote:Maybe this works?


When I used another browser your link worked like a charm. Thanks!

According to the introduction, these questions are really taken from the 1Z0-808 certification test. So these are actual questions! And I scored 100%
 
Ranch Hand
Posts: 221
27
IntelliJ IDE Spring Java
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, everyone.
At first, thanks for your link! It was an interesting, because those were actual exam questions. I also tested myself and all my answers were correct. But then I saw the third question is wrong.



It is written “And this content from Shop.java”. We know that the file name and public class name must be the same but it is different in this code. If we remove public keyword this code does compile.

But it is asked compiling Shop class in question. But we have no Shop class, we have only Shop.java file. According this the code should be as following:

I don’t believe the actual exam question would be wrong, maybe it is typo of java magazine editor.

[edit] removed other questions (might be copyright infringement)
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mushfiq Mammadov wrote:But then I saw the third question is wrong.
...
It is written “And this content from Shop.java”. We know that the file name and public class name must be the same but it is different in this code. If we remove public keyword this code does compile.
...
But it is asked compiling Shop class in question. But we have no Shop class, we have only Shop.java file. According this the code should be as following:


That's a real belter you have spotted. Have a cow!

I think the question is/was intended to be like "Which code fagment can be inserted at line n1 to enable the OnlineCart class to compile" and the second code snippet should be

Mushfiq Mammadov wrote:I don’t believe the actual exam question would be wrong, maybe it is typo of java magazine editor.


And even if this question from the Java Magazine was on the actual exam, you will certainly select the correct answer. Because the question tells you to select one correct answer and options A, C, and D are definitely wrong (you can't extend from a final class, a top-level class can't be declared with private or protected access modifier), so B must be the correct answer

Hope it helps!
Kind regards,
Roel

PS. I removed the other questions from your post, because I don't know if you are allowed to copy them from the Java Magazine (and thus it might be copyright infringement). Hope that's ok with you!
 
Mushfiq Mammadov
Ranch Hand
Posts: 221
27
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Roel De Nijs wrote:PS. I removed the other questions from your post, because I don't know if you are allowed to copy them from the Java Magazine (and thus it might be copyright infringement). Hope that's ok with you!


I thought that these questions were shared publicly. Therefore I thought that there was no problem if I would share them. If you remove so everything is ok. You know the best

P.S. Thanks for a cow!
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mushfiq Mammadov wrote:

Roel De Nijs wrote:PS. I removed the other questions from your post, because I don't know if you are allowed to copy them from the Java Magazine (and thus it might be copyright infringement). Hope that's ok with you!


I thought that these questions were shared publicly.


They are indeed shared publicly (if you register for the magazine), but I don't know if you can copy/share these questions in another format (jpg/png) than the magazine. That's why I deleted them (Oracle is very lawsuit-savvy so better be safe than sorry )
 
Ranch Hand
Posts: 49
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had also a score of 100%, but I found the question pretty easy. Unfortunately they did not published the really hard question ( I think so ).

Notwithstanding I had to wonder about the second question with the anwers a and b, because I could not decide me if the reference e1 is out of scope in that code , but I think so, because it is actually a local variable and the main method is closed, isn't it ?

It would be nice if someone could explain me, whether it is false, what I am thinking of or whether I simplicity understood the question false. THANK YOU for the reading. (:
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Kamil Hlubek,

First of all, a warm welcome to CodeRanch!

Kamil Hlubek wrote:Notwithstanding I had to wonder about the second question with the anwers a and b, because I could not decide me if the reference e1 is out of scope in that code , but I think so, because it is actually a local variable and the main method is closed, isn't it ?


If the main method is finished, the object (created at line4) is (obviously) eligible for garbage collection. But after line6 is executed, the object (created at line4) is not eligible for garbage collection because you can still refer to this object using local variable e1.

Hope it helps!
Kind regards,
Roel
 
Kamil Hlubek
Ranch Hand
Posts: 49
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Roel De Nijs wrote:Hi Kamil Hlubek,

First of all, a warm welcome to CodeRanch!

Kamil Hlubek wrote:Notwithstanding I had to wonder about the second question with the anwers a and b, because I could not decide me if the reference e1 is out of scope in that code , but I think so, because it is actually a local variable and the main method is closed, isn't it ?


If the main method is finished, the object (created at line4) is (obviously) eligible for garbage collection. But after line6 is executed, the object (created at line4) is not eligible for garbage collection because you can still refer to this object using local variable e1.

Hope it helps!
Kind regards,
Roel



Thank you, The result is, that I missunderstood the question (:
 
Mushfiq Mammadov
Ranch Hand
Posts: 221
27
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is written regarding the above typo in November/December 2015 issue of Java Magazine, on page 7

 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mushfiq Mammadov wrote:It is written regarding the above typo in November/December 2015 issue of Java Magazine


Your name published in the Java Magazine. Nice! Maybe I can offer my services to do a technical review of these questions in the future
 
Mushfiq Mammadov
Ranch Hand
Posts: 221
27
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Roel De Nijs wrote:Maybe I can offer my services to do a technical review of these questions in the future


It is a good idea Maybe the next OCP questions will be published in the January/February issue.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic