Paul Anilprem

Enthuware Software Support
+ Follow
since Sep 23, 2000
Merit badge: grant badges
Cows and Likes
Cows
Total received
51
In last 30 days
0
Total given
3
Likes
Total received
555
Received in last 30 days
3
Total given
150
Given in last 30 days
0
Forums and Threads

Recent posts by Paul Anilprem

Oracle has discontinued upgrade certifications.
You can now either go for 1z0-819 (for OCP Java 11) or go for 1z0-829 (for OCP Java 17).
The third point of the explanation explains why it will print PT3H.


public static Duration between(Temporal startInclusive, Temporal endExclusive)///

1. Duration.between method computes the duration between two temporal objects.  If the objects are of different types, then the duration is calculated based on the type of the first object. For example, if the first argument is a LocalTime then the second argument is converted to a LocalTime. (Not the case here because both arguments are of ZonedDateTime).

2. In this case, the difference between the two zones is 3 hours therefore the resulting duration will contain 3 hours.

3. The result of Duration.between method can be a negative period if the end is before the start. This is NOT the case here. Therefore, the Duration.between will return be plus 3 hrs and not minus 3 hours.



But here is a simple test program that will put your doubt to rest



It is true that 6am in LA is 9am in NY but that doesn't mean LA is before NY. Quite the opposite. Whatever the time is currently in NY, the same time happens 3 hours later in LA. So, 9AM in LA happens 3 hours later (or after) than 9 AM in NY. That is why LA is 3 hours behind (or 3 hours after) NY.

The explanation has been enhanced to make this point clearer.
The variable declaration List<? extends Number> list implies that list contains objects of some class that extends Number but you(or the compiler) has no idea which class it is. It may not necessarily be Integer. It could be Double also, in which case, putting Integer in that list will mess it up. Since the compiler cannot guarantee that putting an Integer in the list will keep the list consistent with other elements in the list, it refuses to compile.

One might think that they are assigning  new ArrayList<Integer> to list, so what is the problem? Two things - one - compiler doesn't know the actual object type. It goes by information available at compile time, which is, the declared type of the variable. Two - what if list is assigned a value using a method call like this: list = someMethod(); What if this method returns a list that is supposed to contain only Doubles? Putting an Integer in that list will cause problems in other places in the code where Doubles are expected in that list.

Check out this post for more details.


Congratulations on passing, Ervin! Good to hear that your issues were resolved  
You will receive an email with an invoice. It will have the invoice number, amount, and bank account details. You have to pay as per the instructions in that email. See this for details: https://enthuware.com/resources/certification-faq/253-purchasing-java-certification-exam-voucher-from-oracle-india
Yes. No need to take OCA.

No. Topics on the exam range from basic to advanced.

It covers all topics required for the exam. But All exams topics != Entire Java.

There is no other book but several mock exams are available.
This picture is grossly outdated. Most of the exams mentioned in it have been discontinued for quite a while now.

The 1z0829 exam has no prerequisites. You can just take it without worrying sbout any other exam. It is a single exam conducted in one sitting.

For details, refer the source: https://education.oracle.com/  
Congratulations on passing  
Glad to know that our mock exams were helpful in your preparation. Thanks for mentioning it in your article.
Simon is probably talking about switch expressions but you don't have to worry about it for the 1z0-808 exam because this exam is based on Java 8 and the new switch expressions feature has been available only since Java 12.

1 month ago
+ hasn't worked for me for months. Earlier it worked on Firefox but not on Chrome or Edge. Not it is not working on Firfox either.


Congratulations and Merry Christmas !!
This is a special case as explained in JLS Section 5.2 Aiignment contexts :
~

if the expression is a constant expression (§15.28) of type byte, short, char, or int:

A narrowing primitive conversion may be used if the type of the variable is byte, short, or char, and the value of the constant expression is representable in the type of the variable.



What constitutes a narrowing primitive conversion is explained just above 5.2.

Les Morgan wrote:krishna,

... white space is highly subjective to the audience and who is paying the bills.

Les



While true in general, the white space OP is asking about is an entirely different thing.