Reputation: 83
I'm writing an application that I'd like to be able to accept and hold the user's input of a combination of numbers and letters (06712A1, for instance), and then input that info into an array. I assume I can't use Integer since there are letters inside it. How do I do this?
Upvotes: 0
Views: 78
Reputation: 24281
You need to use the String
datatype to represent a sequence of characters.
This tutorial on Strings in java might be useful.
Upvotes: 1
Reputation: 24885
Your question is ambiguous.
I assume you mean that you want to use that String as an index
to another object. In that case, search for the java.util.Map
subclass that suits you.
Upvotes: 0
Reputation: 11592
Use a String and then validate it by examining all the letters it contains.
What do you mean by "input that info into an array"? Put each character into a separate position in an array?
Upvotes: 1