Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+17 votes

So for saving data, I am using a JSON file, I watched some tutorials and some people has a file ending with .js and the others .java. What should it look like? What type of a file should it be.

And if its a java file is it possible to write into it and edit it from a different class?

If anyone did this part and have any ideas please let me know :)

asked in CSC305 Fall 2022 by (1 point)

1 Answer

+7 votes

Maybe just hold off a few days -- I will help teams out with JSON in lecture!

Short version: make up your own file extension, like ".3dboard", but you'll still save it using a text file format.

We'll use the GSON library to read/write the data into JSON format.

answered by (508 points)
...