title: How should I assign some values from a txt file to an array in Java?
body: <p>I just started to learn Java. As the title says... I would like to know how should I assign some values from a txt files to an array in Java to work with them (for example to sort them).</p>
  
  <p>For example in C++:</p>
  
  <pre><code>#include&lt;fstream&gt;
  using namespace std;
  
  int v[10];
  int main()
  {
      ifstream fin("num.txt");
      int i;
      for(i=0;i&lt;10;i++)
          fin&gt;&gt;v[i];
  }
  </code></pre>
  
  <p><strong>Right guys. Thank you for all the information. I see that is a little bit more complicated than C++, but I'll learn this. Furthermore, when I was intern at a small company I saw that the employees there made a code which scanns an XML files. I guess it's much more complicated, but that's fine. :)</strong></p>