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).
Bernhard Goetz wrote:You may have to log in to your oracle account to access the content.
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!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.
Bernhard Goetz wrote:Maybe this works?
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:
Mushfiq Mammadov wrote:I don’t believe the actual exam question would be wrong, maybe it is typo of java magazine editor.
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!
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.
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 ?
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
Mushfiq Mammadov wrote:It is written regarding the above typo in November/December 2015 issue of Java Magazine
Roel De Nijs wrote:Maybe I can offer my services to do a technical review of these questions in the future
Don't get me started about those stupid light bulbs. |