can you write 2 jason files that have similar structure but different contents? whatever is ok, as long as they can compile and run successfully. thanks
时间: 2024-03-27 13:37:53 浏览: 54
快速解决VS Code报错:Java 11 or more recent is required to run. Please download and install a recent JDK
5星 · 资源好评率100%
Sure, here are two sample JSON files with similar structure but different contents:
File 1: data1.json
```
{
"name": "John Doe",
"age": 30,
"address": {
"street": "123 Main St",
"city": "Anytown",
"state": "CA",
"zip": "12345"
},
"phoneNumbers": [
{
"type": "home",
"number": "555-555-1234"
},
{
"type": "work",
"number": "555-555-5678"
}
]
}
```
File 2: data2.json
```
{
"name": "Jane Smith",
"age": 25,
"address": {
"street": "456 Elm St",
"city": "Othertown",
"state": "NY",
"zip": "67890"
},
"phoneNumbers": [
{
"type": "home",
"number": "555-555-4321"
},
{
"type": "work",
"number": "555-555-8765"
}
]
}
```
Both files have the same structure with a name, age, address, and phoneNumbers field, but with different specific values. These files should be able to compile and run successfully as valid JSON files.
阅读全文