arrangement of sentences

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • litun
    New Member
    • Mar 2008
    • 12

    arrangement of sentences

    hi
    i want to arrange the sentences as per their line numbers,i.e,in ascending order.i have the line numbers stored in an array list and the sentences in another array list.how can i arrange them?plzz help me,its urgent.waiting for reply,bye
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by litun
    hi
    i want to arrange the sentences as per their line numbers,i.e,in ascending order.i have the line numbers stored in an array list and the sentences in another array list.how can i arrange them?plzz help me,its urgent.waiting for reply,bye
    I don't know what 'plzz' means and why this is urgent but I'd suggest a little class:

    [code=java]
    public class Sentence {
    private int line;
    private String text;
    //
    public Sentence(int line String text) {
    this.line= line;
    this.text= text;
    }
    //
    // getters here
    //
    }
    [/code]

    kind regards,

    Jos

    Comment

    • BigDaddyLH
      Recognized Expert Top Contributor
      • Dec 2007
      • 1216

      #3
      Jos is right. The parallel structure you noticed in your code (two separate lists) is a sign you are suffering from "object denial". Time to define the proper objects!

      Comment

      Working...