Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You will first of course need to <strong>read a file</strong>, which you can learn how to do here.<br> <a href="https://stackoverflow.com/questions/2788080/reading-a-text-file-in-java/2790621#2790621">Java: How to read a text file</a></p> <p>This example will provide several ways you may <strong>write the file</strong> once you have sorted your data.<br> <a href="https://stackoverflow.com/questions/2885173/java-how-to-create-and-write-to-a-file/2885254#2885254">How do I create a file and write to it in Java?</a> </p> <p>As for sorting, I recommend creating a class Movie, which would look similar to </p> <pre><code>public class Movie implements Comparable&lt;Movie&gt; { private String name; private String leadActor; private Date releaseDate; public Movie(String name, String leadActor, String releaseDate) { } @Override public int compareTo(Movie other) { } } </code></pre> <p>Ill leave it to you fill in the rest of the constructor and compareTo method. Once you have your compareTo method you will be able to call Collections.sort(List list) passing your list of Movie.</p> <p>Here are some resources on <strong>implementing Comparable</strong>.<br> <a href="http://docs.oracle.com/javase/tutorial/collections/interfaces/order.html" rel="nofollow noreferrer">http://docs.oracle.com/javase/tutorial/collections/interfaces/order.html</a><br> <a href="https://stackoverflow.com/questions/3718383/java-class-implements-comparable/3718515#3718515">Why should a Java class implement comparable?</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload