Given the following properties file,
abc=10
bcd=20
cde=11
def=321
how can I get the first key of the property file (in this case abc)?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Don’t use
java.util.Properties, basically. That’s based on a hash table, which has no concept of ordering.It’s not clear what the context is, but if at all possible, use a known key as “the most important” or whatever you’re trying to achieve.