The Oracle Tutorial page for Temporal Query page shows this sample code.
- The code
TemporalQueries query = TemporalQueries.precision(); System.out.printf("LocalDate precision is %s%n",LocalDate.now().query(query));
When I compile this segment code, the compiler throws an error:
- Mistake
TemporalQueryExample.java:8: error: incompatible types: TemporalQuery<TemporalUnit> cannot be converted to TemporalQueries TemporalQueries query = TemporalQueries.precision(); ^ TemporalQueryExample.java:10: error: no suitable method found for query(TemporalQueries) LocalDate.now().query(query)); ^
I don't know if this java 8 documentation tutorial example is true or not, but I copy this code segment and paste in my IDE and then the IDE gives an error.
java java-time
AK.Sharma Oct 24 '17 at 5:48 on 2017-10-24 05:48
source share