Java SQL Date toInstant() MethodThe toInstant() method of Java Date class always throws an UnsupportedOperationException. As SQL Date values don't have time component so this method should not be used. This method overrides toInstant in class Date. SyntaxParametersNA ReturnsIt returns an instant which represents the same point on the time-line as this date object. ExceptionUnsupportedOperationException is thrown if the method is invoked. ExampleTest it NowOutput: Exception in thread "main" java.lang.UnsupportedOperationException at java.sql/java.sql.Date.toInstant(Unknown Source) at date.JavaDateExample1.main(JavaDateExample1.java:12) |