user3349850
user3349850

Reputation: 225

Data structure for n*4 tables in java

1   2   3   Canada
5   4   8   Australia
8   4   6   India
7   6   4   New Zealand
5   6   1   Zurich
3   3   8   New York
8   3   3   Philippines
6   3   2   Holland

How can I maintain the data structure in java 1.4 version for above requirement? Each row will be constructed with data from more than one database.

How to insert the row values in to that data structure?

At last after constructing the above table, the table has to sorted based on Country name .

Upvotes: 0

Views: 69

Answers (1)

Martijn Courteaux
Martijn Courteaux

Reputation: 68847

Create a class like this:

public class MyDataRecord
{
    int a, b, c;
    String str;
}

Then hold an array or ArrayList of this type:

MyDataRecord[] records0 = new MyDataRecord[...];
List<MyDataRecord> records1 = new ArrayList<MyDataRecord>();

Upvotes: 2

Related Questions