Meaningless Drivel is fun!*
The moose likes Beginning Java and the fly likes A question about read message from resource from java class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "A question about read message from resource from java class" Watch "A question about read message from resource from java class" New topic
Author

A question about read message from resource from java class

Thomas Chang
Ranch Hand

Joined: May 13, 2008
Posts: 61
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?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38763
    
  23
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.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

...or user the Properties class which does the splitting and mapping part for you.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: A question about read message from resource from java class