233.
234.
235.
236.
237.
238.
239.
240.
241.
242.
243.
244.
245.
246.
Explain with appropriate code samples the different ways in
which you can create a LocalDate.
Explain with a code sample how
you can check if a date is
before another date.
Explain the ZonedDateTime class.
What will be the output of the following code snippet?
How can you obtain the day of the week corresponding to a
date using the Java 8 DateTime API?
Explain the differences between
the Period and Duration
class.
Suppose you have a String date in the yyyy/mm/dd format.
How can you obtain a LocalDate object corresponding to such
a date?
What is the output of the following code snippet?
Explain how you can find out if a year
is a leap year using the
new DateTime API.
Sta c and Default Interface Methods
What are static and default methods? Why were they
introduced by Java 8?
What is the difference between
an abstract class and an
interface after Java 8?
Write a code sample that demonstrates a default method.
What is the difference between a static and a default interface
method?
Identify the error in the following
code snippet and explain how
it can be fixed.
247.
248.
249.
250.
251.
252.
253.
254.
255.
256.
257.
258.
259.
260.
Op onals
What is an Optional and why was it added by Java 8?
How can an Optional be created?
Explain the Optional.ifPresent method with a code sample.
What is the difference between the orElse and orElseThrow
method?
What will be the output of the following code snippet?
Do'stlaringiz bilan baham: