Question: Java An instance of the Date class is a particular point in time: The time is represented by the number of milliseconds from a fixed

Java

An instance of the Date class is a particular point in time:

The time is represented by the number of milliseconds from a fixed point (epoch), which is 00:00:00 UTC (January 1, 1970)

UTC is the Coordinated Universal Time, the scientific time standard, which is practically the same as the Greenwich Mean Time (GMT)

The Date class is not very useful for manipulating the kind of calendar info humans use for dates, such as March 6, 2017.

This particular description of a day follows the Gregorian calendar, which is the calendar used in most countries of the world.

The LocalDate class expresses days in the familiar calendar notation

The LocalDate class is part of the java.time package

You do not use constructors to construct objects of the LocalDate class

The LocalDate class contains static methods for.

Constructing the current date:

LocalDate currentDate = LocalDate.now()

Constructing an object for a specific date:

LocalDate deadline = LocalDate.of(year, month, day)

Once you have a LocalDate object, you can find out the year, month, day

int year = deadline.getYear(); //int

int month = deadline.getMonthValue(); //int

int day = deadline.getDayOfMonth(); //int

There are plusDays(int days), plusYears(int yrs), etc. methods that return a new LocalDate that is a given number of days, years, etc. away from the original date

LocalDate birthYear = currentDate.plusYears(-30);

Question:

Use the LocalDate class to write a program that displays a calendar for the current month as shown below

The current day is marked with an asterisk (*).

Note that the program needs to know how to compute the length of a month and weekday for a given day. Please make use of Javadoc.

Mon

Tue

Wed

Thu

Fri

Sat

Sun

1

2

3

4

5

6*

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!