Java Instant query() methodThe query() method of Java Instant class is used to query the instant using the specified query. This method uses the specified query strategy object. The TemporalQuery object defines the logic to be used to obtain the result. SyntaxParametersR - As we can see in the syntax, there is R which is denoted as a type parameter which specifies the type of the result. query - It specifies the query to invoke. Parameters cannot be null. ReturnsIt returns the query result. It may be returned Null value which is defined by the query. ExceptionDateTimeException - If unable to query (defined by the query) ArithmeticException - If numeric overflow occurs (defined by the query) Example 1Output: America/Sao_Paulo Example 2Output: 2017-05-01T20:57:09.883Z Nanos Example 3Output: Local Date is Days Next TopicJava-instant-compareto-method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India