• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Questions/errata for Sybex OCP 17 Study Guide

 
Ranch Hand
Posts: 90
5
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Right before Creating .class Files for inner Classes on page 384, one can read the following:

"[...] Java solves this by calling new as if it were a method on the room variable. [...]"

I had some difficulties with this sentence and had to re-read it a few time. I think what you really mean is:

"[...] Java solves this by calling new as if it were a method on the home variable. [...]"

Guillaume
 
author & internet detective
Posts: 42022
916
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Confirmed and added to the errata. Good catch! Have a cow
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

While on pages 519 and 520, it is correctly stated that values (respectively keys) cannot be null for TreeSet (respectively TreeMap), it is somewhat imprecise on page 491 in my opinion. One can read there:

"...The data structures that involve sorting do not allow null values."

There is indeed no mention of keys here, and TreeMap can actually store null values.

Guillaume
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Spoiler alert, this is a question about the review questions at the end of chapter 9.

I don't really get why option B in question 7 is seen as valid (pages 524 and 940).
After all, if I were to declare Alpaca as an interface, this wouldn't be true.

Can someone enlighten me?

Thanks a  lot!

Kind regards,
Guillaume
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

On page 627, there is a minor difference between the code and the output of the DateTimeFormatter.

Using the format "h:mm z", the code would actually print something like 6:15 EDT.
The output 06:15 EDT actually corresponds to the format "hh:mm z".

Guillaume
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

If I may make one suggestion, I would mention DateTimeException (er even UnsupportedTemporalTypeException) at the top of page 626 (instead of RuntimeException).
This makes it clearer in my opinion that there is a similar behavior in case of error between this code and the code on page 627.

Guillaume
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I would like to add some precision to what is stated on page 636 about CompactNumberFormat.
At the bottom of the page, the rules mention that only a maximum of three digits will ever be printed.

This is true most of the time but not always. For example, the following code will print 9223372T:

Guillaume
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

For completeness, I would make the following changes (or something similar) in Table 12.15 on page 700.

-p <path>
--add-modules <names>
--output <dir>


Guillaume
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Spoiler alert, this is a question about review question 1 of chapter 12 on page 713.

I understand that a valid named module needs to have a module-info.java file at the root of the package structure.
But why would this module not already be valid if we consider it as an automatic module?

Thanks for your answers.

Kind regards,
Guillaume
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Answer to review question 17 of chapter 12 on page 950 mentions module.info at the end instead of module-info.java.

Guillaume
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I will here report a few things that caught my attention.

My understanding is that the following sentences might need to be adapted.
Notice however that I might be wrong.

"First, it looks at the source and seeing three elements" (middle of page 565)
=> not exactly grammatically correct

"Aside from BooleanSupplier, they all involve the double, int, or long primitives." (top of page 580)
=> not sure how this relates to the text that precedes

"The sum() method returns an int rather than an OptionalInt because the sum of an empty list is zero." (answer to review question 8 of chapter 10 on page 943)
=> technically this is not a list but a stream

Review question 20 of chapter 10 on page 590
=> there is actually no explicit link between the Optional of the question and the variable opt in the answers

"[...] which make option H the final answer." (answer to review question 11 of chapter 12 on page 950)
=> the phrasing is a little bit weird, since D and G are also right

Kind regards,
Guillaume
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

This is a correction for review question 4 of chapter 13.

In my opinion is answer B not correct, unlike what is stated on page 952.
When I run the code, line w1 compiles fine as ScheduledExecutorService extends ExecutorService.

Guillaume
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I just wanted to add some precision to table 14.9 on pages 823-824.

The method public byte[] readAllBytes() is actually defined in InputStream.
The method public void write(String line) is actually defined in Writer.

Guillaume
 
Jeanne Boyarsky
author & internet detective
Posts: 42022
916
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Guillaume Bailly wrote:
While on pages 519 and 520, it is correctly stated that values (respectively keys) cannot be null for TreeSet (respectively TreeMap), it is somewhat imprecise on page 491 in my opinion. One can read there:

"...The data structures that involve sorting do not allow null values."

There is indeed no mention of keys here, and TreeMap can actually store null values.


Confirmed line 491 is an errata and logged it.
 
Jeanne Boyarsky
author & internet detective
Posts: 42022
916
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Guillaume Bailly wrote:Hi,

Spoiler alert, this is a question about the review questions at the end of chapter 9.

I don't really get why option B in question 7 is seen as valid (pages 524 and 940).
After all, if I were to declare Alpaca as an interface, this wouldn't be true.

Can someone enlighten me?



I wrote a whole long explanation of why and then got to the end and realized it was wrong. Logged as an errata.

The quick test is to use an @Override tag and see if it is allowed. It is not.
 
Jeanne Boyarsky
author & internet detective
Posts: 42022
916
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Guillaume Bailly wrote:On page 627, there is a minor difference between the code and the output of the DateTimeFormatter.

Using the format "h:mm z", the code would actually print something like 6:15 EDT.
The output 06:15 EDT actually corresponds to the format "hh:mm z".


Agreed and added to the errata. That should have been hh:mm z.

Guillaume Bailly wrote:If I may make one suggestion, I would mention DateTimeException (er even UnsupportedTemporalTypeException) at the top of page 626 (instead of RuntimeException).
This makes it clearer in my opinion that there is a similar behavior in case of error between this code and the code on page 627.


This was intentional. We didn't want to get into which one.

Guillaume Bailly wrote:I would like to add some precision to what is stated on page 636 about CompactNumberFormat.
At the bottom of the page, the rules mention that only a maximum of three digits will ever be printed.

This is true most of the time but not always. For example, the following code will print 9223372T:

Guillaume


Ooh interesting. I'm going to add that to our list of things to consider for next book. I don't know whether it is an edge case or worth covering.
 
Jeanne Boyarsky
author & internet detective
Posts: 42022
916
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Guillaume Bailly wrote:For completeness, I would make the following changes (or something similar) in Table 12.15 on page 700.

-p <path>
--add-modules <names>
--output <dir>


I made a note to consider this for next time.

Guillaume Bailly wrote:Spoiler alert, this is a question about review question 1 of chapter 12 on page 713.

I understand that a valid named module needs to have a module-info.java file at the root of the package structure.
But why would this module not already be valid if we consider it as an automatic module?


I think it is ok to not explicitly state it is a named module. But made a note to consider it for next time.

Guillaume Bailly wrote:Answer to review question 17 of chapter 12 on page 950 mentions module.info at the end instead of module-info.java.


We don't always use the file extensions; especially when clear from the context. I made a note to consider adding it because it doesn't hurt anything, but I think it is fine.
 
Jeanne Boyarsky
author & internet detective
Posts: 42022
916
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Guillaume Bailly wrote:"First, it looks at the source and seeing three elements" (middle of page 565)
=> not exactly grammatically correct


This is fine. As an native English speaker, it sounds like something someone could say.

Guillaume Bailly wrote:"Aside from BooleanSupplier, they all involve the double, int, or long primitives." (top of page 580)
=> not sure how this relates to the text that precedes


"They" is the list of all the streams two sentences back plus all the optional types in the previous sentence.

Guillaume Bailly wrote:"The sum() method returns an int rather than an OptionalInt because the sum of an empty list is zero." (answer to review question 8 of chapter 10 on page 943)
=> technically this is not a list but a stream


Agreed. Noted on list of things to change for next time.

Guillaume Bailly wrote:Review question 20 of chapter 10 on page 590
=> there is actually no explicit link between the Optional of the question and the variable opt in the answers


This seems fine to me. We talk about Optional and then use a variable.

Guillaume Bailly wrote:"[...] which make option H the final answer." (answer to review question 11 of chapter 12 on page 950)
=> the phrasing is a little bit weird, since D and G are also right


This is correct. It's the final answer. D and G were earlier answers.
 
Jeanne Boyarsky
author & internet detective
Posts: 42022
916
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Guillaume Bailly wrote:Hi,

This is a correction for review question 4 of chapter 13.

In my opinion is answer B not correct, unlike what is stated on page 952.
When I run the code, line w1 compiles fine as ScheduledExecutorService extends ExecutorService.

Guillaume


The answer is correct in the book.  The question doesn't ask which lines don't compile. It asks which lines would need to be changed. You can't assign it to a regular Executor because then the "scheduleWithFixedDelay" call won't work.
 
Jeanne Boyarsky
author & internet detective
Posts: 42022
916
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Guillaume Bailly wrote:I just wanted to add some precision to table 14.9 on pages 823-824.

The method public byte[] readAllBytes() is actually defined in InputStream.
The method public void write(String line) is actually defined in Writer.


True, I'll make a note to see if we want to change that next time
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I think I get what is meant by the following sentence (bottom of page 735), but it is rather confusing in my opinion:

"Unlike Runnable, in which the get() methods always return null[...]"

This sentence could give the impression that there are get() methods on a Runnable.

Unless there is something I miss...

Guillaume
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

When looking at the Java API, it appears that CallableStatement actually extends from PreparedStatement instead of being a sibling.

So, while they both are subinterfaces of Statement (as correctly stated on page 873), the drawing could perhaps be updated to better reflect the reality.

Guillaume
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

If I understand correctly, and based on the example for JDBC OUT parameter with CallableStatement on page 889, every OUT parameter also counts as a parameter and needs to have a corresponding ? when calling the procedure.

In this case, I don't really understand why the procedure in review question 14 of chapter 15 only mentions a single ? as parameter.
There, I would expect two ? inside the parentheses since there is one IN parameter and one OUT parameter.

Am I missing something?

Thanks for your answers.

Guillaume
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Just some suggestions that crossed my mind as I was reading the book:

The note on page 762 says "The Stream interface includes a method isParallel() [...]"
This might sound like Stream defines this method, while it actually inherits it from BaseStream.
With interfaces there is not a big difference, except for us to know that this method is also available for primitive streams.

The copy() method on page 798 is rather confusing since it actually does a move operation.

The box on top of page 814 is missing bold font for one "forName" (unless there is a reason for this).

Although table 15.7 on page 888 clearly describes the procedures that follow, I would have found it useful to also see the output for the procedures that are called in the following pages.

For review question 6 of chapter 15 on page 901, I would add single quotes around the word Jenga.

About review question 17 of chapter 14 (pages 858 and 957), I understand why option F is not correct, although I think it could have been a little bit better justified.
I read "Files is part of NIO.2, whereas File is part of java.io, which means option F is incorrect."
The real reason to me is that Files.readAtributes() works with the Path interface.

Guillaume
 
Jeanne Boyarsky
author & internet detective
Posts: 42022
916
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Guillaume Bailly wrote:"Unlike Runnable, in which the get() methods always return null[...]"

This sentence could give the impression that there are get() methods on a Runnable.


I see that. Added to the list of things we should change. Interestingly, it was like that in the Java 8 and 11 versions of the book too.

Guillaume Bailly wrote:When looking at the Java API, it appears that CallableStatement actually extends from PreparedStatement instead of being a sibling.

So, while they both are subinterfaces of Statement (as correctly stated on page 873), the drawing could perhaps be updated to better reflect the reality.


We were going for clarity here. Both are Statements. The subinterface thing could confuse people. That said, will consider again for next book.

Guillaume Bailly wrote:In this case, I don't really understand why the procedure in review question 14 of chapter 15 only mentions a single ? as parameter.
There, I would expect two ? inside the parentheses since there is one IN parameter and one OUT parameter.


The ?= is the OUT parameter here. The format can vary by database.
 
Jeanne Boyarsky
author & internet detective
Posts: 42022
916
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for all the comments

Guillaume Bailly wrote:The note on page 762 says "The Stream interface includes a method isParallel() [...]"
This might sound like Stream defines this method, while it actually inherits it from BaseStream.
With interfaces there is not a big difference, except for us to know that this method is also available for primitive streams.


We don't talk about BaseStream in the book. The reader doesn't need to know it exists.

Guillaume Bailly wrote:The copy() method on page 798 is rather confusing since it actually does a move operation.


Added to errata.

Guillaume Bailly wrote:The box on top of page 814 is missing bold font for one "forName" (unless there is a reason for this).


No reason

Guillaume Bailly wrote:Although table 15.7 on page 888 clearly describes the procedures that follow, I would have found it useful to also see the output for the procedures that are called in the following pages.


This was intentional. It doesn't matter what the stored procedures do.

Guillaume Bailly wrote:For review question 6 of chapter 15 on page 901, I would add single quotes around the word Jenga.


Agreed that this is wrong. Added to errata.

Guillaume Bailly wrote:About review question 17 of chapter 14 (pages 858 and 957), I understand why option F is not correct, although I think it could have been a little bit better justified.
I read "Files is part of NIO.2, whereas File is part of java.io, which means option F is incorrect."
The real reason to me is that Files.readAtributes() works with the Path interface.


We often include only one incorrect reason. I'm ok with that.
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Since records are final, it is correct that they cannot be extended or inherit another record, as stated on page 377.

What was not clear to me was whether a record could extend from another class.
So I tried, and apparently all records already inherit a class, namely java.lang.Record.

Just thought it might be interesting to explicitly mention this, just in case.

Guillaume
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Spoiler alert, this post is related to question 'tb864585.JaSE17SG.pe1.07' in the online test bank.

The question and the answers are correct.
However, the answer mentions snakes.isEmpty() instead of snakes.toString().

Guillaume
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Just a typo for question 'tb864585.JaSE17SG.pe2.15' in the online test bank.

Instead of

"Which are the following are valid lambdas that can..."

One should read

"Which of the following are valid lambdas that can..."

Guillaume
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

While I get the point behind the flashcard 'fc864585.JaSE17SG.1.049' in the online tool, it leads to confusion in my opinion (which might be on purpose).

It says "True or false? A switch expression is always required to have a default statement when assigning the result to an int value."
And then "True, since handling every possible int value would be untenable."

While the answer is correct on its own, I'm not sure it really answers the question.

Since we're talking about the result of the expression, the example below is how I see things, which is perfectly valid code.


Guillaume
 
Jeanne Boyarsky
author & internet detective
Posts: 42022
916
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Guillaume Bailly wrote:Hi,

Spoiler alert, this post is related to question 'tb864585.JaSE17SG.pe1.07' in the online test bank.

The question and the answers are correct.
However, the answer mentions snakes.isEmpty() instead of snakes.toString().

Guillaume


Confirmed and added to the errata


Guillaume Bailly wrote:Hi,

Just a typo for question 'tb864585.JaSE17SG.pe2.15' in the online test bank.

Instead of

"Which are the following are valid lambdas that can..."

One should read

"Which of the following are valid lambdas that can..."

Guillaume


Agreed. I added that to our list of things to fix. I didn't put on the errata since it is so minor.
 
Jeanne Boyarsky
author & internet detective
Posts: 42022
916
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Guillaume Bailly wrote:Hi,

While I get the point behind the flashcard 'fc864585.JaSE17SG.1.049' in the online tool, it leads to confusion in my opinion (which might be on purpose).

It says "True or false? A switch expression is always required to have a default statement when assigning the result to an int value."
And then "True, since handling every possible int value would be untenable."

While the answer is correct on its own, I'm not sure it really answers the question.


Good point. I think we were thinking of and int in the switch as well. I'll make a note in our list of things that could be clearer. Thanks!
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

For online flashcard "fc864585.JaSE17SG.1.025" with following content:

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

I would add char to the answer (not a "natural" numeric type, but still holds true for completeness).

Guillaume
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Chapter 6, Q.34:

I understand that there are no true good choices here as all of them are useless. It gets down to pick the least worse 2 options among them.

Valid solutions are B and E. I agree with E but not with B. I think they should be D and E.

In a nutshell as a quick reminder:



B) (a, b) -> 5
D) (a, b) -> {words.add("awesome"); return 0;}
E) (a, b) -> {return 0;}



It is true that functions should be stateless as a general directive but not as a contract constraint. As far as the function is consistent throughout time it does not matter whether it has state or not. In this case the (D) function has a side effect (rather than state) which is having a list being modified. But the list is never read again so this side effect is harmless. It could be the opposite as well, a stateless function which is not consistent by calling Math.random(). The important thing is consistency rather than state or side effect, as I see it.

Now, option B is not valid though. We cannot be sure on the final result. It depends on how many chunks the parallel stream will be split into. With 0 it is ok because 0 + 0 = 0 and we are back where we started at, so the final result will always be 0 regardless of the execution plan. But 5 + 5 is not 5. The java specification states that the following condition must hold true:

  combiner.apply(u, accumulator.apply(identity, t)) == accumulator.apply(u, t)

In this question:
  combiner = (s1, s2) -> s1 + s2
  accumulator = (a, b) -> 5
  identity = 0

Then we have that:
  u + 5 == 5

The only way this condition holds is to be sure that u (the intermediate value) is 0 (the provided identity). In other words, it must be run sequentially in a single chunk. But we have forced a parallel execution. The execution model should not have impact on the final result.



 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

On page 624, the first paragraph in "Formatting Numbers" mentions a NumberFormat interface.
Actually, NumberFormat is an abstract class.

Guillaume
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Cristian Uceda Garrido wrote:
[...]By the way, should not it be parallel() instead of parallelStream()?[...]


parallelStream() is correct, as you have a List here.
parallel() can only be used on a Stream.
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Cristian Uceda Garrido wrote:
[...]
Chapter 6, Q.34:
[...]


Strange, Stream is in chapter 10 in OCP 17 Study Guide.
Are you sure you mean ch. 6 q. 34? (I can't find it anywhere)
I would like to help but...

Guillaume
 
Cristian Uceda Garrido
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Guillaume Bailly wrote:

Cristian Uceda Garrido wrote:
[...]
Chapter 6, Q.34:
[...]


Strange, Stream is in chapter 10 in OCP 17 Study Guide.
Are you sure you mean ch. 6 q. 34? (I can't find it anywhere)
I would like to help but...

Guillaume



Mmmm... I am realizing maybe this is not exactly the thread where I should have posted it. I was referring to OCP ORACLE CERTIFIED PROFESSIONAL JAVA SE 17 DEVELOPER PRACTICE TESTS.
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

The following is just a suggestion for online question "tb864585.JaSE17SG.at.25"

The option H for line 12 of the program does not really make sense in my opinion and could be removed or changed to line 11 or something else.

Just my 2 cents.

Guillaume
 
Guillaume Bailly
Ranch Hand
Posts: 90
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Regarding online question tb864585.JaSE17SG.c04.14, the answer mentions new Instant() as a valid option.
There is no public no-arg constructor for Instant actually, so this answer should be removed.

Guillaume
 
You can't have everything. Where would you put it?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic