• 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
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

1Z0-829 exam experience, possible erratas in Sybex

 
Greenhorn
Posts: 2
2
  • Likes 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone!

I took my exam today, successfully with 72 %. First of all, I would like to thank Jeanne and Scott for great study guide - thank you. My experience with exam is same as already mentioned here - little time, lot of code to read and poor display resolution of testing tool - makes it hard to read. You can mark questions to review them at the end, but I didn't have time to do it. I was happy to answer all 50 questions, last three almost without reading. Also Enthuware tests are perfect, almost same questions like in the exam.

I have few questions/erratas about online test bank:
1. Flashcard questions

Which functional interface takes zero parameters and has a get() method?


And on the other side is Consumer. I think it should be Supplier.

Besides itself, which primitive types can be implicitly cast to int?


There is byte and short, what about char?

What are the names of the options available to set a classpath in a java or javac command?


There is -cp, --classpath, and -class-path, but should be --class-path and -classpath.

Also there was question about what commands takes module path and answer was like: "java, javac, jlink, jdeps takes -p or --module-path ..." - but jdeps takes only --module-path, -p means package according to study guide and --help command.

2. Practice exam 3

Which three functional interfaces can fill in the blanks to make the code compile? (Choose three.)




Options:
A. Consumer<Double>
B. DoubleConsumer
C. Function<Long, Double>
D. Function<String, Double>
E. LongToDoubleFunction
F. ToDoubleFunction<String>

Explanation:

Lines 6 and 7 both call the method applyAsDouble() rather than apply(). This tells us that the answer is a primitive functional interface, ruling out options C and D. The primitive versions are correct with options E and F. Line 8 calls accept(), making it a consumer. Option A is the remaining correct answer.



I was wondering why DoubleConsumer was not correct answer.

3. Book
Answers and explanations, chapter 14, typo in bold:
B, C, E.  Options B and C are properties of NIO.2 and are good reasons to use it over the java.io.File class. Option A is incorrect as both APIs can delete only empty directories, not a directory tree. Using a view to read multiple attributes leads to fewer round trips between the process and the file system and better performance, making option E correct. Views can be used to access file system–specific attributes that are not available in Files methods; therefore, option D is correct. Files is part of NIO.2, whereas File is part of java.io, which means option F is incorrect.

Review questions, chapter 7, question 28:

Finally, Eagle does not compile because it declares an abstract method soar() in a concrete class, making option D correct.


And also missing return type  

Thank you so much!

Good luck to others and have nice day.
 
Enthuware Software Support
Posts: 4856
52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Congratulations!!
 
Marshal
Posts: 79697
381
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Radek Novotný wrote:. . .

Which functional interface takes zero parameters and has a get() method?


And on the other side is Consumer. I think it should be Supplier.

Did you quote that question exactly? It is not quite precise; functional interface don't have parameters. Their methods have parameters. I think you are correct about Supplier however.

. . .

Besides itself, which primitive types can be implicitly cast to int?


There is byte and short, what about char? . . .

Agree: see JLS (=Java® Language Specification). I haven't got the time to look at your other points, but shall award you a cow for the effor you put into that post.
And (again) congratulations
 
Saloon Keeper
Posts: 3928
43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Congratulations !
 
Radek Novotný
Greenhorn
Posts: 2
2
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:

Radek Novotný wrote:. . .

Which functional interface takes zero parameters and has a get() method?


And on the other side is Consumer. I think it should be Supplier.

Did you quote that question exactly? It is not quite precise; functional interface don't have parameters. Their methods have parameters. I think you are correct about Supplier however.

. . .

Besides itself, which primitive types can be implicitly cast to int?


There is byte and short, what about char? . . .

Agree: see JLS (=Java® Language Specification). I haven't got the time to look at your other points, but shall award you a cow for the effor you put into that post.
And (again) congratulations



Yes, it is copy & paste, question on flashcard fc864585.JaSE17SG.2.128 (I don't know if this is unique for my login).

Thanks for reply and cow

And thanks who congratulated me, it is my first certification and I am quite happy about it.
 
author & internet detective
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Replying in segments. This post is for the flashcards.

Radek Novotný wrote:

Which functional interface takes zero parameters and has a get() method?


And on the other side is Consumer. I think it should be Supplier.


Confirmed and added to the errata.

Radek Novotný wrote:

Besides itself, which primitive types can be implicitly cast to int?


There is byte and short, what about char?.


While char is correct, this isn't covered in the book and is out of scope of what you need ot know for the exam.

Radek Novotný wrote:

What are the names of the options available to set a classpath in a java or javac command?


There is -cp, --classpath, and -class-path, but should be --class-path and -classpath.


Confirmed and added to the errata.

Radek Novotný wrote:Also there was question about what commands takes module path and answer was like: "java, javac, jlink, jdeps takes -p or --module-path ..." - but jdeps takes only --module-path, -p means package according to study guide and --help command.


I can't find this flashcard.
 
Jeanne Boyarsky
author & internet detective
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This post is for the practice exam

Radek Novotný wrote:2. Practice exam 3

Which three functional interfaces can fill in the blanks to make the code compile? (Choose three.)




Options:
A. Consumer<Double>
B. DoubleConsumer
C. Function<Long, Double>
D. Function<String, Double>
E. LongToDoubleFunction
F. ToDoubleFunction<String>

Explanation:

Lines 6 and 7 both call the method applyAsDouble() rather than apply(). This tells us that the answer is a primitive functional interface, ruling out options C and D. The primitive versions are correct with options E and F. Line 8 calls accept(), making it a consumer. Option A is the remaining correct answer.



I was wondering why DoubleConsumer was not correct answer.


A and B are both correct answers. Added to errata.
 
Jeanne Boyarsky
author & internet detective
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

And for the book

Radek Novotný wrote:
3. Book
Answers and explanations, chapter 14, typo in bold:
B, C, E.  Options B and C are properties of NIO.2 and are good reasons to use it over the java.io.File class. Option A is incorrect as both APIs can delete only empty directories, not a directory tree. Using a view to read multiple attributes leads to fewer round trips between the process and the file system and better performance, making option E correct. Views can be used to access file system–specific attributes that are not available in Files methods; therefore, option D is correct. Files is part of NIO.2, whereas File is part of java.io, which means option F is incorrect.


Confirmed and added to the errata.

Radek Novotný wrote:
Review questions, chapter 7, question 28:

Finally, Eagle does not compile because it declares an abstract method soar() in a concrete class, making option D correct.


And also missing return type  


While this is true, we didn't feel the need to mention everything wrong with it.

Have two cows for your great finds. Also, congrats on passing the cert!
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I bough a OCP 17 hard copy. would like to know where to find source code in GIT for the examples given in the book.
please share the link.
 
sj Jabbar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Chapter 1
Page 20
Creating a Jar

I am able to compile and run my class Zoo.java
But not able to create a jar, below is an error

----------------------------------------------
D:\command-base>jar -cvf Zoo.jar
'c' flag requires manifest or input files to be specified!
Try `jar --help' for more information.
----------------------------------------------


After google found that need to add class .

D:\command-base>jar -cvf Zoo.jar Zoo.class
added manifest
adding: Zoo.class(in = 410) (out= 284)(deflated 30%)

Is my understanding is  correct to add class name with a command  ?



 
sj Jabbar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Chapter 1
page 31

Can anyone explain why output is -56 for line 2.  What is the logic here. I tried other number and it is keep change when it is out of its range.

      1-Double apple= Double.valueOf("200.99");
       2-System.out.println("byteValue d="+apple.byteValue()); // -56
       3-System.out.println("intValue d="+apple.intValue());
       4-System.out.println("doubleValue d="+apple.doubleValue());


Output:
byteValue d=-56
intValue d=200
doubleValue d=200.99
 
Mikalai Zaikin
Saloon Keeper
Posts: 3928
43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Perhaps, because upper range of byte primitive type is 127, so 200 cannot fit as positive.
Please check the explanation on the picture

byte.jpg
[Thumbnail for byte.jpg]
 
sj Jabbar
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the response, But still not understand how -56  is the results.
200-56=144  // still not -56/correct
200-128=72 //  still no -56/correct

Would you elaborate picture please. What is the formula used here.
 
Paul Anilprem
Enthuware Software Support
Posts: 4856
52
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Formula is this:
1. First check the bit pattern of the number: 200 is 0xC8. i.e. 11001000
2. Since the first bit is a 1, this will be interpreted as a negative number (because byte is signed).
3. The value that negative number will be produced using 2's complement method. (flip the bits and add 1). So, 00110111 + 1 =  00111000 = 32+16+8 = 56.
Since it is supposed to be a negative number, the final number is -56.
 
Paul Anilprem
Enthuware Software Support
Posts: 4856
52
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
BTW, the circular representation of the numbers is misleading because of the involvement of the 2's complement method.
 
Greenhorn
Posts: 25
3
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sj Jabbar wrote:Thanks for the response, But still not understand how -56  is the results.
200-56=144  // still not -56/correct
200-128=72 //  still no -56/correct

Would you elaborate picture please. What is the formula used here.



The range of byte is between +127 and -128, so including 0 you have 256 possible numbers (200-256= -56, but that's not the way of calculating the casted result).
When you try to cast a number that is higher or lower than this range, it just "loops" over it.
Let's see what happens with positive numbers:
int i1 = 127 -> short 127
int i2 = 128 -> short -128
int i3 = 129->short -127
...
int i4 = 200-> short -56
int i5 = 256-> short 0
int i6 = 127+256-> short 127 (a whole loop is 256).
For negatives number is the same but the loops goes in the other direction.
This function tries to give a practical use of what Paul explained with his formula:
 
Jeanne Boyarsky
author & internet detective
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sj Jabbar wrote:Hi All,
I bough a OCP 17 hard copy. would like to know where to find source code in GIT for the examples given in the book.
please share the link.


The only code we make available is for the modules chapter (and the setup for JDBC). Both are linked from the book page.. Running the examples by copy/pasting won't prepare you for the exam.
 
Jeanne Boyarsky
author & internet detective
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

sj Jabbar wrote:Is my understanding is  correct to add class name with a command  ?


You are correct. I've added this to the errata
 
MyExamCloud Software Support
Posts: 735
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Congratulations for your Java 17 Developer Certification !
 
Greenhorn
Posts: 12
2
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:

sj Jabbar wrote:Is my understanding is  correct to add class name with a command  ?


You are correct. I've added this to the errata



What exactly is wrong in the book? I see a . (dot) in all jar commands on page 20 for the class names.
 
Jeanne Boyarsky
author & internet detective
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Manuel Trumm wrote:

Jeanne Boyarsky wrote:

sj Jabbar wrote:Is my understanding is  correct to add class name with a command  ?


You are correct. I've added this to the errata



What exactly is wrong in the book? I see a . (dot) in all jar commands on page 20 for the class names.


It's not a missing dot. It is a missing "class".
 
Jeanne Boyarsky
author & internet detective
Posts: 41967
911
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:

Manuel Trumm wrote:

Jeanne Boyarsky wrote:

sj Jabbar wrote:Is my understanding is  correct to add class name with a command  ?


You are correct. I've added this to the errata



What exactly is wrong in the book? I see a . (dot) in all jar commands on page 20 for the class names.


It's not a missing dot. It is a missing "class".


Oh! There's nothing in the surrounding text that talks about only including one class. So Manuel is right. There is no errata as the dot is in the book in both places it is mentioned on the page. Have a cow!
 
She's out of the country right now, toppling an unauthorized dictatorship. Please leave a message with this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic