Friday, 9 August 2013

How to get the content of object, which contain other class

How to get the content of object, which contain other class

When i start program, it gives me link to object, i want to get the
content. Where's my mistake?
I'm thinkin' that problem in storage.addRecord(record) in ReaderXls.class.
Result: Reading is over Start reading from Storage work2obj.Record@2910d926
public class Start {
public static void main(String[] args) {
System.out.println("Start reading from Xls");
ReaderXls read = new ReaderXls();
Storage storage;
storage = read.ReadXls("Text1obj",0,1);
System.out.println("Reading is over");
System.out.println("Start reading from Storage");
System.out.println(storage.getRecord(1));
}
}
..
public class Storage
{
List<Record> record;
public Storage(){
this.record = new ArrayList<Record>();
}
..
public Record getRecord(int number){
return this.record.get(number);
}
}
..
public class ReaderXls {
public Storage ReadXls(String sfilename,int firstColumn, int lastColumn){
Storage storage = new Storage();
try {
Record record = new Record(j, Integer.parseInt(ContentCount), RowContent);
storage.addRecord(record);
}
}

No comments:

Post a Comment