In Java, data formats refer to the structured representation of data for storage or communication. Commonly used data formats include:
JSON (JavaScript Object Notation): Lightweight, text-based format for exchanging data.
Library: Jackson, Gson
Example: {"name": "John", "age": 30}
XML (Extensible Markup Language): Hierarchical, tag-based format.
Library: JAXB, DOM, SAX
Example: <person><name>John</name><age>30</age></person>
CSV (Comma-Separated Values): Tabular data in plain text.
Library: Apache Commons CSV
Example: John,30
These formats are commonly used for file I/O, API communication, or data serialization.