What is the general function of the Period and Duration classes?

What is the general function of the Period and Duration classes?



Answer: Both classes share the same methods that allow them to manage spans of their respective units: Period corresponds to date and Duration corresponds to time. They can be created with generic methods such as ofYears(5), ofMinutes(3), between(ld1, ld2), etc.

What is the general function of the LocalDateTime class?

What is the general function of the LocalDateTime class?



Answer: has the same time zones and methods of the LocalTime and LocalDate classes, representing date followed by time in one object. The format for date and time are usually separated by a capital T.

What is the function of the parse(CharSequence text) and parse(CharSequence text, DateTimeFormatter formatter) methods of the LocalDate class?

What is the function of the parse(CharSequence text) and parse(CharSequence text, DateTimeFormatter formatter) methods of the LocalDate class?



Answer: Creates an Object from the string provided it is in ISO 8601 format. If the optional formatter object is included, then the String could must be phrased as such.