What's new

Closed Convery Month Number To Month Name

Status
Not open for further replies.

Shinzenryu

Eternal Poster
Joined
Jun 4, 2015
Posts
1,395
Reaction
236
Points
335
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.

Similar threads

Back
Top