Ok, I am stumped here. I really looked into this and cant seem to find specifically what I am trying to do. I am two weeks into Java in school and new to programming so please pardon any errors I may make.
I am working on a string manipulation program and among other tasks in it I am to create a sting called names that holds SunMonTueWedThuFriSat, now I need to figure out how to grab and display in JOptionPane the 3 characters in that string that go with the numbers I am supposed to associate with them (0=Sun, 1=Mon, etc.) So if the user inputs 2 it should display Tue. I have a basic understanding on how to display those characters in a string, but for the life of me i cant seem to figure out how to associate those numbers with those characters. Every time I try to work something I keep getting errors and frustration.
Thanks for all your help!!!
You should be able to just use substring, since all the abbreviations are three characters.
Prompt the user to enter a number (0-6):
Now convert it to a number
And select the right portion of the string:
Now just show this day in a JOptionPane: