🔒 Closed Convery Month Number To Month Name

Status
Not open for further replies.

Shinzenryu

Eternal Poster
Hey guys, tina-try kong mag aral ng programming and Java yung napili kong language. Nahihirapan ako sa arrays. How do i convert yung number na ii-input ng user to it's corresponding name using String array?

String[] month = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October","November", "December"};

How do i convert yung month number para yung output na idi-display ay yung month name? Thanks
 
Because arrays index starts at 0.

if you want to display January from you array

try this

System.out.println(month[0]);
 
Status
Not open for further replies.

About this Thread

  • 4
    Replies
  • 335
    Views
  • 2
    Participants
Last reply from:
Shinzenryu

Trending Topics

Online now

Members online
1,164
Guests online
1,610
Total visitors
2,774

Forum statistics

Threads
2,293,202
Posts
29,082,358
Members
1,208,711
Latest member
Polyxeni
Back
Top