473,382 Members | 1,442 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Problem with accessing elements in objects in arraylist

when you add an object to an array list how do u access the elements of the objects that u add????

eg:
vertex v;
arrayliast.add(v)

now how do you get the value of the weight element of the v object which is in the array list????? plz send a reply ASAP
Jul 28 '07 #1
1 1141
kenobewan
4,871 Expert 4TB
What do mean weight? The arraylist[n].value? One way is lenght if it is the newest item.
Jul 29 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Jason Callas | last post by:
I have a weird problem with a sorted ListBox which is bound to an ArrayList. My ArrayList is holding a collection of custom objects. One of the public properties is called Name. When I add a few...
4
by: Lei Jiang | last post by:
I have an ArrayList that contains 100 elements. Some of these elements are referenced by other objects, but the ArrayList itself is not referenced by any objects. Is the ArrayList could be GC'ed? ...
14
by: Sharon | last post by:
Hi all. I have an ArrayList and sometimes while enumerating through, i get an exception because another thread has added to the ArrayList. To solve this problem, i lock the enumeration, passing...
5
by: Jack Addington | last post by:
How do I go about accessing elements of an Arraylist using something other than the index? I have a class that manages a number of subclasses. Those subclasses are stored in an arraylist. The...
3
by: JJ | last post by:
Hi, I have created an Arraylist object from an Arraylist class. I added rows to the arraylist object and I need to find a particular record in my arraylist. How do I do this? Also if I was in...
3
by: geoffblanduk_nospam | last post by:
Given a set of intervals {i1, i2, i3, ...} a list is produced; the base items (0) are placed one at a time into the stream and after the ix one a interval item (1, 2, 3, etc) of the correct type is...
24
by: RyanTaylor | last post by:
I have a final coming up later this week in my beginning Java class and my prof has decided to give us possible Javascript code we may have to write. Problem is, we didn't really cover JS and what...
2
by: chrisaotto | last post by:
I have a three part question concerning the proper use of Dispose -- specifically when I have a collection of elements (contianed in an ArrayList) that each implement the IDisposable interface. ...
1
sid0404
by: sid0404 | last post by:
Hi How do I print elements of an ArrayList of an ArrayList, I think it has to be something similar to a 2 D array, but with a difference, my child arraylist has different number of elements say I...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.