Properties and YAML
On This Lesson 4 topics
The content for this lesson is written and waiting for review. The outline below shows what it covers. It will be published once it is approved.
In this lesson
read settings from a file.
Planned topics
- A
.propertiesfile haskey=valuelines. - YAML uses indentation for nesting and is easy to read; spaces matter, tabs are not allowed.
- Put the default file on the classpath (
src/main/resources). - Read values with
Properties.load(plain Java) or a framework later. - Give a clear error if a required value is missing.
Draft outline details
Demonstration
shop.currency=EUR
shop.tax-rate=0.19shop:
currency: EUR
tax-rate: 0.19Check your understanding
What must you avoid in YAML indentation?
Show answer
Tabs; use spaces.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.