generate the actual month

M

[Miren]

Hello yi am trying to print into the console the actual month, one month.
i want to make one method for printing one month passing to the method the
nunber of the month.

X X 1 2 3 4 5
6 7 8 9 10 11 12
12 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 X X X

i am trying this using the Calendar class but i don't know how to make it.

can anybody helps me?

thanks
 
O

Oscar kind

Hello yi am trying to print into the console the actual month, one month.
i want to make one method for printing one month passing to the method the
nunber of the month.

X X 1 2 3 4 5
6 7 8 9 10 11 12
12 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 X X X

i am trying this using the Calendar class but i don't know how to make it.

What exactly are you trying to to?

It seems like displaying a calendar of all the days in a month, but since
you didn't say, it's just a guess. By the way: "the actual month" is not
quite descriptive enough: you could mean the name of the month...

Assuming you mean "a calendar displaying the days of the month", note the
following:
- a Calendar object represents a date (or more accurately a timestamp).
- a Calendar object has values for several fields, three of them being
Calendar.MONTH, Calendar.DAY_OF_MONTH and Calendar.DAY_OF_WEEK.
- a Calendar object can tell the actual minimum and maximum values for a
field, for example Calendar.DAY_OF_MONTH, given it's current date.
- a Calendar objects supports an add method, which you can use to loop
over a month (even backwards if you wish).
 
M

[Miren]

i want to print one calendar object,
i want to make one method with 2 params (motnh and year), and with this two
params to print the month.
Can you help me?
thanks
 
O

Oscar kind

i want to print one calendar object,
i want to make one method with 2 params (motnh and year), and with this two
params to print the month.
Can you help me?

I did: I listed all things you need to know about Calendar objects to
generate the output you mean. To actually do this is up to you.

Unless you mean I should write some code for you. In that case I'm sorry,
but my time is extremely limited until the new year. I can't spend any on
tutoring.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,681
Members
48,796
Latest member
Greg L.

Latest Threads

Top