hi there, i need to write a program which i can enter the first desired ascii character, and the last, and the program prints the list to the screen, but i dont know how to get started, do the characters have a numerical relation, please help Bob
Yes, characters can be interchanged with numbers. ASCII is basically a mapping for doing just that. The character 'A' is 65, and 'B' is 66, for example.
If you write
System.out.println(65)
you see the number 65, but if you cast the number to a "char", then you'll see the character 'A':
System.out.println((char) 65);
Note that Java doesn't actually use ASCII -- it uses Unicode, which is a (huge) superset. For your purposes, this might not matter.
Since characters are really represented as numbers under the hood, this means that you can "count" with them. So to print out every character in a given range, it sounds like a loop of some kind would be helpful. Does this give you any ideas where to start?
Once you have made a crack at working on this, post some of your code and we can help you refine it. Also, if you have any compiler errors, post those along with some indication of which line causes each error.
hello, im new and i need help with something similar.[Deleted because what was posted was completely different. Please post your question again as a new thread.]
"freddie mercury", please check your private messages for an important administrative matter.
Also, please be sure to use code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along to posts that are easier to read. Please read this for more information.
You can go back and change your post to add code tags by clicking the button on your post.
And, "Freddy Mercury" please do not ask questions unrelated to the original topic. So as to allow Bob Holland his thread back, I am afraid I feel obliged to delete most of your posting.