jQuery in Action, 3rd edition
The moose likes Beginning Java and the fly likes arrayList access to Object's instance variables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "arrayList access to Object Watch "arrayList access to Object New topic

arrayList access to Object's instance variables

kavundamani senthil

Joined: Feb 28, 2008
Posts: 16
In the program below how can i access the fields bankName, accId from the object o ?

import java.util.*;
public class sorting {
String bankName ;
int accId;
public void addaccount(String bankName,int accId)
this.bankName = bankName;
this.accId = accId;
public static void main(String args[])
TreeSet t = new TreeSet();
sorting s = new sorting();
sorting s1 = new sorting();
Iterator it = t.iterator();
object o = it.next();}
Paul Somnath
Ranch Hand

Joined: May 19, 2008
Posts: 177

Preparing for SCJP 6.0
I agree. Here's the link: http://aspose.com/file-tools
subject: arrayList access to Object's instance variables
It's not a secret anymore!