• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

what can be presumed outside/in other module-info.java files

 
Saloon Keeper
Posts: 1328
40
Eclipse IDE Postgres Database C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Another question I got wrong today:

Suppose module puppy depends on module dog and module dog depends on module animal. Fill in the blank so that code in module dog can access the animal.behavior package in module animal.


module animal {
  _______ animal.behavior;
}


A. export
B. exports
C. require
D. requires
E. require transitive
F. requires transitive
G. None of the above



I went back and forth between B. and G. a few times before moving on, landed on G. and got it wrong.
This is all that is required in the file shown, so B. -- but, I was reminded of other questions where something else had to happen somewhere else, i.e. in another class or another file, in order to get the desired result, so the answer was "None of the above".  If the question had included the words "if dog requires animal" I would have spent less time on it and gotten it right.

I now see that the words:

"module dog depends on module animal."



didn't just imply a logical dependence, but were meant to imply that the dog module indeed had a module-info.java that either said
requires animal
or
requires transitive animal

Definitely a case of correctly interpreting what we are supposed to know about what is happening "off screen" is key...

Not sure if I am grousing, warning others, or this is an evolutionary adaptation to prevent me from forgetting this before taking a Real Exam (by reflecting and writing about it).  Maybe a combination of all three.
 
Saloon Keeper
Posts: 13282
292
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Again, another good case for why multiple choice questions suck.
 
Jesse Silverman
Saloon Keeper
Posts: 1328
40
Eclipse IDE Postgres Database C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And to satisfy the Grammar Police without angering the TVA, we were meant to infer that, rather than to imply it.

Instead of saying that multiple choice questions suck, but without disagreeing, I will say they are very hard to write and to answer correctly without causing test takers to grouse, or to get them wrong, without the "I wanna call my lawyer!" feeling.
 
Stephan van Hulst
Saloon Keeper
Posts: 13282
292
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, I think I said it best when I said they suck.

The problem with multiple choice questions is that they devalue the certification itself. Multiple choice questions are a poor test of a person's true knowledge. People who don't know the material as good as they should can get a certification by being lucky, while a person who really knows their beans can lose points on the type of issue you've demonstrated in this topic.

Multiple choice exams are easy to score en masse, which is another indicator of reduced quality.
 
Jesse Silverman
Saloon Keeper
Posts: 1328
40
Eclipse IDE Postgres Database C++ Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm still facing them, so complaining too loudly about them could sound like sour grapes coming from me.

We definitely have a good share of posts on this forum asking for help in "What can I and what can't I assume when trying to answer X?" rather than actual questions about proper Java usage itself.
To make that worse, it is often impossible to answer such questions definitively, we wind up suggesting heuristic methods (of question-answering, not of coding).

I try to help answer those well, but I still get bit in the butt by the same issues sometimes, like yesterday.
 
Jesse Silverman
Saloon Keeper
Posts: 1328
40
Eclipse IDE Postgres Database C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One more thing that may suck for me.

On many of these tests with very tight time constraints, when presented with a lot of code to read, I find reading it aloud actually helps to go faster.
That is, reading it aloud and listening to it once == reading it silently three or four times.

When my wife hears me doing this, she helpfully reminds me "No talking, you just auto-failed your test!"

We have heard this actually happening to others on real exams, sometimes let off with a warning for the first offense, but if it happens again...

On Live Coding challenges, the opposite often applies.  You don't want "Dead Air" because they want to learn how you think.

On those, I try to reason thru everything they give us and the initial approach to the problem in a calm, clear voice, including the parts I am not sure of yet and will need to watch out for.

A little discombobulating when you need to switch from one mode to the other on the same day!
 
Jesse Silverman
Saloon Keeper
Posts: 1328
40
Eclipse IDE Postgres Database C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, Stephan, this one is for you.

Mock Exam Question #20 in the Sybex 815 book by Scott and Jeanne:

Which statements about the following class are correct? (Choose all that apply.)




A. The object created on line 4 is eligible for garbage collection after line 8.
B. The object created on line 4 is eligible for garbage collection after line 13.
C. The object created on line 5 is eligible for garbage collection after line 9.
D. The object created on line 5 is eligible for garbage collection after line 13.
E. The object created on line 6 is eligible for garbage collection after line 11.
F. The object created on line 6 is eligible for garbage collection after line 13.
G. The call to System.gc() guarantees garbage collection will run.
H. The call to System.gc() is the only time garbage collection will run in this program.

I said B, C, D and F.  I saw that A was wrong because Hopper was holding on to a reference to that object, so not A.  Then E, same thing, now Hopper is holding on to a reference to THAT object, so it isn't eligible for garbage collection after line 11.

Well, to D or NOT to D?  That was the question.  Had the question said *becomes* eligible or is first eligible, I would have NOT said D, because it became eligible earlier, not at that moment.
However, here I am thinking is = 'becomes or remains', so D. applies too.
I know many people on this site detest garbage collection eligibility questions.
I think they are reasonable, but would greatly prefer the words 'becomes eligible' 'is first eligible' or 'first becomes eligible' for clarity.

When it came to answer D I feel like I had the little Devil and Angel on my shoulder from....."Was that Animal House?" one telling me to mark it and one telling me not to.
The one who was telling me not to would have been marked right.  I won't say which is which to avoid taking the analogy too far.

The fact that G and H are in there further made me want to put D.  In reality, the odds that garbage collection has already run at that line are near nil, of course it is eligible for garbage collection at that line and likely will be for quite some time...whatever, multiple choice is rough...
 
Stephan van Hulst
Saloon Keeper
Posts: 13282
292
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So what's the answer? I would have answered B, C, D and F, same as you. I made sure to pick my answers before I read the rest of your post.

I prefer the way the options were phrased. It's unambiguous. An object either is or is not eligible for garbage collection. An object is eligible for garbage collection if it is no longer reachable. In any other case, it's not eligible.

After line 13, all local variables of the main method go out of scope, and since there are no fields referring to any objects, none of the objects created in the main method will be reachable, and therefore all of them will be eligible.

Whether or not the garbage collector has already run halfway through the method doesn't matter. It's unknowable and therefore you should assume that it hasn't run.

If option D should not be marked, then the problem is not that it was phrased ambigously. The problem is that whoever wrote the test picked the wrong answers.
 
Jesse Silverman
Saloon Keeper
Posts: 1328
40
Eclipse IDE Postgres Database C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:So what's the answer? I would have answered B, C, D and F, same as you. I made sure to pick my answers before I read the rest of your post.

I prefer the way the options were phrased. It's unambiguous. An object either is or is not eligible for garbage collection. An object is eligible for garbage collection if it is no longer reachable. In any other case, it's not eligible.

After line 13, all local variables of the main method go out of scope, and since there are no fields referring to any objects, none of the objects created in the main method will be reachable, and therefore all of them will be eligible.

Whether or not the garbage collector has already run halfway through the method doesn't matter. It's unknowable and therefore you should assume that it hasn't run.

If option D should not be marked, then the problem is not that it was phrased ambigously. The problem is that whoever wrote the test picked the wrong answers.



The question (well, the answers) wanted us NOT to mark D.

This one is for Jeanne and Scott now, then.
I am always wary of being in the "Coming up to the Professor's Desk Arguing For Points On the Test Mode", despite the fact that the mock test authors aren't in charge of giving you any grade, just accurately preparing you for all the knowledge and skills that will be required on the real test.
I truly appreciate the hard work that goes into ensuring that a Multiple Choice Question has one right combination of answers, but both of us got this marked wrong despite having the same detailed understanding of Garbage Collection Eligibility.  I'd be happy either with a re-phrasing or keeping the question as-is and making D correct, but at least one or the other should happen.
These ambiguous questions really kill my timings, which is part that I am working hard on.
 
Jesse Silverman
Saloon Keeper
Posts: 1328
40
Eclipse IDE Postgres Database C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just wanted to add another two cents on Stephan's comments on multiple-choice tests in general vs. the OCPJP.

Regarding a recent discussion I had with my nephew on multiple choice tests where he was saying how easy they were and I am not finding it that way.

MCQ's intended to be easy (perhaps because they want a lot of students to take the course or certification they are selling because it is seen as an easy A) will have a lot of questions like:

Who created the programming language Python?

A. Monty Python
B. Guido Von Rossum
C. Father Guido Sarducci
D. Campbell Ritchie

There are three obviously wrong answers, and what you said about "You could not know stuff very well and still pass" is very true.
He also said he didn't think a single person "ran out of time" on any test he had taken for months, most people finish in about one third the time given, very few take more than half the time allowed.

I would modestly state the time pressure on the OCPJP is a bit more pressing.

The OCPJP normally has the possible correct answers, A, B, C, D, E, F, G, A and B and C....A, and B and C and D and E and G, etc.  including things such as "Will not compile for another reason" and "None of the Above".

In my experience, even with "Test-taking tips and tricks" memorized and in full force, it is NOT easy to accidentally get a question you don't have full knowledge of right.
What Jeanne termed as a "Wild ass guess" in reply to an earlier post of mine (where I determined we were both from NYC, as that is what people from here would call it) normally has between a 20% chance and 3% chance of being right.

So it is asymmetrical in my opinion.  Yes, they prefer MCQ because it is so easy to grade, however, it is far easier to get a question marked wrong that you had substantial knowledge on than to get a question marked right that you really didn't understand.

Not in general, but on Oracle Cert Exams, yes, and certainly on mock exams that I have encountered, you are way more likely to get something wrong despite having knowledge than to just guess your way into a meaningful number of correct answers.

If the number of questions you don't have near-mastery on is close to the number you can afford to get wrong and still pass, I would say "you're toast" as the family-friendly Bowlderization for what I am really thinking:
https://www.merriam-webster.com/dictionary/bowdlerize
 
I have gone to look for myself. If I should return before I get back, keep me here with this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic