Java | Save Game data in file/ Load it
<p>I am trying to develop a little game in Libgdx/Java :) But before i implement a save system, i got some questions about it :</p>

<p>I often see, no i always see that games stores there game variables in files.
And i already know how to save my data into an xml file ... which looks so :</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;Word&gt;Hello&lt;/Word&gt;
</code></pre>

<p>But is that efficient ? Or are there better methods to save data in files ? And is it worth to store data in files?
An other little question is, how do i load that stuff out of this file above there? And example, if i wanna load the Word "Hello" into an String ... how do i do that?</p>

<p>I found some interesting posts but they didn't work, maybe they are outdated :/ </p>

<p>Heres one : <a href="https://stackoverflow.com/questions/7373567/java-how-to-read-and-write-xml-files/7373596#7373596">Java: How to read and write xml files?</a></p>