Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

Errors in the OCP Java SE 11 Programmer I study guide practice exams

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!

How can I ask about the questions in the practice exam on testbanks.wiley.com? There are three questions that I think have wrong answers (or I really don't understand how they could be correct and would like to be explained, the explanations provided in the feedback don't support the "correct" answers), but I am not sure whether writing them out here would be a correct way to do it.
 
Marshal
Posts: 68904
275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you would be all right writing practice exam questions to check for errors. How can we explain the answers, or would we have to sit the practice exam ourselves?
 
Kairi Kübarsepp
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi again,

Alright. Here goes:

1) One question claims that the answer "Set<Boolean, Character>" is correct. The question itself is irrelevant here, because Set couldn't take two generic types. Another answer variant is "Map<String>", so I feel that maybe the <> may have gotten mixed up in the test choices.

2) The question "Which of the following are ordered from smallest to largest? (Choose all that apply.)" allows only one answer, which according to the feedback is "float, double". I agree with this, but there is also the option "byte, short, int, long", so two should be correct i.e. it should be possible to select two answers.

3) In which order can you assemble the following lines to make a valid Java program? (Choose all that apply.)

R. /* hello world */
S. ArrayList list;
T. import java.util.*;
W. package abc;
X. public class Builder {
Y. public void method() {}
Z. }

The feedback shows that the answer "R, W, T, X, Y, S, Z" is incorrect as the package statement must be the first line. However, R is a comment, which is non-executable code, so it can be anywhere. It runs fine when I compile it in IntelliJ:

R. /* hello world */
W. package abc;
T. import java.util.*;
X. public class Builder {
Y. public void method() {}
S. ArrayList list;
Y. public void method() {}
Z. }

Thanks in advance for any information you can give me
 
Campbell Ritchie
Marshal
Posts: 68904
275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Kairi Kübarsepp wrote:. .  the <> may have gotten mixed up in the test choices. . . .

Agree: that does look like a printing error.

"Which of the following are ordered from smallest to largest? . . .

The correct answer is, “None of the above”. A float isn't smaller than a double, but “narrower”. The real Oracle exam will probably use the official terms as in the JLS (=Java® Language Specification), which are “wider” and “narrower”.
Arranged in order from narrow to wide: float double and byte short int long.

3) In which order can you assemble the following lines to make a valid Java program? . . .

That isn't a complete program, but what they want is a compilable class. You showed R W T X Y S Y Z. If you get rid of the duplicated Y that will compile, yes.

I suggest you submit those to Wiley as errors. It looks as though they had been desperate to get something out in time for the Java11 exams and haven't taken the time to verify the suggested answers.
 
author & internet detective
Posts: 39957
804
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just like the book, this forum is a good place!

Kairi Kübarsepp wrote:1) One question claims that the answer "Set<Boolean, Character>" is correct. The question itself is irrelevant here, because Set couldn't take two generic types. Another answer variant is "Map<String>", so I feel that maybe the <> may have gotten mixed up in the test choices.


This is already in the errata under bonus exam 1 question 6. (The question number may vary based on randomization)

Kairi Kübarsepp wrote:2) The question "Which of the following are ordered from smallest to largest? (Choose all that apply.)" allows only one answer, which according to the feedback is "float, double". I agree with this, but there is also the option "byte, short, int, long", so two should be correct i.e. it should be possible to select two answers.


The correct answer we submitted is both B and F. I'll reach out to the publisher about fixing the radio button vs checkbox rendering problem.

Kairi Kübarsepp wrote:3) In which order can you assemble the following lines to make a valid Java program? (Choose all that apply.)

R. /* hello world */
S. ArrayList list;
T. import java.util.*;
W. package abc;
X. public class Builder {
Y. public void method() {}
Z. }

The feedback shows that the answer "R, W, T, X, Y, S, Z" is incorrect as the package statement must be the first line. However, R is a comment, which is non-executable code, so it can be anywhere. It runs fine when I compile it in IntelliJ:

R. /* hello world */
W. package abc;
T. import java.util.*;
X. public class Builder {
Y. public void method() {}
S. ArrayList list;
Y. public void method() {}
Z. }


This is also in the errata under question #71
 
This. Exactly this. This is what my therapist has been talking about. And now with a tiny ad:
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic