Created
October 7, 2010 20:09
-
-
Save ejknapp/615801 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package java112.labs2; | |
| import java.io.*; | |
| import java.util.*; | |
| /** | |
| * @author Eric Knapp | |
| * class PropertiesDemo | |
| * | |
| */ | |
| public class PropertiesDemo { | |
| private Properties properties; | |
| public void run() { | |
| loadProps(); | |
| System.out.println("author: " + properties.getProperty("author")); | |
| System.out.println("email: " + properties.getProperty("email")); | |
| } | |
| public void loadProps() { | |
| properties = new Properties(); | |
| try { | |
| properties.load(this.getClass().getResourceAsStream("/analyzer.properties")); | |
| } catch (IOException ioe) { | |
| System.out.println("Can't load the properties file"); | |
| ioe.printStackTrace(); | |
| } catch (Exception e) { | |
| System.out.println("Problem: " + e); | |
| e.printStackTrace(); | |
| } | |
| } | |
| public static void main(String[] args) { | |
| PropertiesDemo demo = new PropertiesDemo(); | |
| demo.run(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment