|
1 | | -Theory Behind the `Package.PropertiesDemo` Program |
| 1 | +Theory Behind the `src/Package/PropertiesDemo.java` Program |
2 | 2 |
|
3 | 3 | ## 1. Introduction to `Properties` Class |
4 | 4 | - The `Properties` class is part of `java.util` and **extends `Hashtable<Object,Object>`**. |
@@ -123,18 +123,18 @@ String os = p.getProperty("OS"); |
123 | 123 | ⸻ |
124 | 124 |
|
125 | 125 | 10. Best Practices |
126 | | - • Always prefer getProperty(key, defaultValue) → prevents null return values. |
127 | | - • For i18n → use ResourceBundle (internally uses Properties). |
128 | | - • For modern applications, prefer UTF-8 XML storage over plain .properties. |
129 | | - • Keep sensitive properties (like DB passwords) encrypted. |
| 126 | +• Always prefer getProperty(key, defaultValue) → prevents null return values. |
| 127 | +• For i18n → use ResourceBundle (internally uses Properties). |
| 128 | +• For modern applications, prefer UTF-8 XML storage over plain .properties. |
| 129 | +• Keep sensitive properties (like DB passwords) encrypted. |
130 | 130 |
|
131 | 131 | ⸻ |
132 | 132 |
|
133 | 133 | 11. Quick Recap |
134 | | - • Properties is a Hashtable-based class specialized for String key-value pairs. |
135 | | - • Can store data in both .properties and .xml formats. |
136 | | - • Provides easy persistence (store/load). |
137 | | - • Extremely useful for configurations, metadata, and i18n. |
138 | | - • Requires caution with encoding, special characters, and overwriting. |
| 134 | +• Properties is a Hashtable-based class specialized for String key-value pairs. |
| 135 | +• Can store data in both .properties and .xml formats. |
| 136 | +• Provides easy persistence (store/load). |
| 137 | +• Extremely useful for configurations, metadata, and i18n. |
| 138 | +• Requires caution with encoding, special characters, and overwriting. |
139 | 139 |
|
140 | 140 | --- |
0 commit comments