Win a copy of Bad Programming Practices 101 (e-book) this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

A question about read message from resource from java class  RSS feed

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a file such as "myinfo.properties" which contains following data:


Now I want to read the message in my java class. How can I do that?
 
Marshal
Posts: 59422
187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
More of a beginner's question;

Split each line on the = and put the first part as Key and the second part as Value in a Map.
 
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...or user the Properties class which does the splitting and mapping part for you.
 
If you have a bad day in October, have a slice of banana cream pie. And this tiny ad:
Why should you try IntelliJ IDEA ?
https://coderanch.com/wiki/696337/IntelliJ-IDEA
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!