Wednesday 17 January 2018

How to create time using of method of Java 8 LocalTime Class | Java 8 Date and Time


Click here to watch on Youtube : 
https://www.youtube.com/watch?v=1K_H4A3Gs_c&list=UUhwKlOVR041tngjerWxVccw

LocalTimeDemo.java

import java.time.LocalTime;

public class LocalTimeDemo
{

    public static void main(String[] args)
    {
        /*
         * Parameters:
         *
         * hour - the hour-of-day to represent, from 0 to 23
         *
         * minute - the minute-of-hour to represent, from 0 to 59
         *
         * second - the second-of-minute to represent, from 0 to 59
         *
         * Returns:the local time, not null
         */

        LocalTime time = LocalTime.of(8, 53, 56);
        System.out.println(time);
    }

}

Output

08:53:56

Click the below link to download the code:
https://sites.google.com/site/ramj2eev1/home/javabasics/LocalTimeDemo_of.zip?attredirects=0&d=1

Github Link:
https://github.com/ramram43210/Java/tree/master/BasicJava/LocalTimeDemo_of

Bitbucket Link:
https://bitbucket.org/ramram43210/java/src/0f51b390145d58b657670d4890d43cef82a5202a/BasicJava/LocalTimeDemo_of/?at=master

See also:
  • All JavaEE Videos Playlist
  • All JavaEE Videos
  • All JAVA EE Links
  • Servlets Tutorial
  • All Design Patterns Links
  • JDBC Tutorial
  • Java Collection Framework Tutorial
  • JAVA Tutorial
  • Kids Tutorial
  • No comments:

    Post a Comment