Search Java Code Snippets

  Help us in improving the repository. Add new snippets through 'Submit Code Snippet ' link.

Java - Code Samples

 Sample 1. Code Sample / Example / Snippet of java.time.LocalTime

    public static LocalTime from(TemporalAccessor temporal) {

Objects.requireNonNull(temporal, "temporal");

LocalTime time = temporal.query(TemporalQueries.localTime());

if (time == null) {

throw new DateTimeException("Unable to obtain LocalTime from TemporalAccessor: " +

temporal + " of type " + temporal.getClass().getName());


return time;


   Like      Feedback      java.time.LocalTime

Subscribe to Java News and Posts. Get latest updates and posts on Java from
Enter your email address:
Delivered by FeedBurner