473,397 Members | 2,099 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,397 software developers and data experts.

Arraylist entries...

nomad
664 Expert 512MB
Hi Everyone:
A liitle confused here about entering info in a Arraylist.

is this how you enter data.

call up the arraylist
Employees = new ArrayList<Employee>();

Employee emp0 = new Employee(0);
emp0.setid("AV1234");
emp0setlname("Doe");
emp0setfname("John");
...
Employee emp1= new Employee(1);
emp1.setid("AV1235");
emp1setlname("James");
...

if not can you please tell me how. I have read about this an now I'm getting more confused about it.
Many Thanks
nomad
PS if so where do I add the info. at the class where I made the arraylist?
Apr 3 '07 #1
2 1248
r035198x
13,262 8TB
Hi Everyone:
A liitle confused here about entering info in a Arraylist.

is this how you enter data.

call up the arraylist
Employees = new ArrayList<Employee>();

Employee emp0 = new Employee(0);
emp0.setid("AV1234");
emp0setlname("Doe");
emp0setfname("John");
...
Employee emp1= new Employee(1);
emp1.setid("AV1235");
emp1setlname("James");
...

if not can you please tell me how. I have read about this an now I'm getting more confused about it.
Many Thanks
nomad
PS if so where do I add the info. at the class where I made the arraylist?
You haven't added anything to the ArrayList yet. To add to the ArrayList you should use the add method. See the docs.
Apr 4 '07 #2
nomad
664 Expert 512MB
Thanks r035198x

I figure out the problem I was having.
Now I discovered my Find Method is not working right and along with storing the info in the arraylist
For some reason when I type in the info for the first time and then go back and do a find on it. It does not find it and continues on with the program.
I have a add method (I think) ...
Need to do some more reading...

nomad
Apr 4 '07 #3

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

Similar topics

6
by: Dan V. | last post by:
I would like to create a 2D string list (2D ArrayList ???). I would like to pass in a table or query as a parameter and have both columns transform into a 2D ArrayList. When I sort the one...
8
by: Phill | last post by:
Anyone know the internal working of this thing. I expected it to be kinda slow at enumerating large lists of objects but it was actually pretty good. I was able to write a quick linked list class...
6
by: GrandpaB | last post by:
While writing this plea for help, I think I solved my dilemma, but I don't know why the problem solving statement is necessary. The inspiration for the statement came from an undocumented VB...
4
by: blisspikle | last post by:
The following sub form1_load reads in a text file that will say something like the text below. I think that the problem is that every time I add a class V_Sensor into the arraylist it puts it in...
18
by: JohnR | last post by:
From reading the documentation, this should be a relatively easy thing. I have an arraylist of custom class instances which I want to search with an"indexof" where I'm passing an instance if the...
0
by: Grant Wickman | last post by:
Our team has just fixed a really nasty problem that appears to be caused by an obscure bug in the sort method of Arraylist and daisy-chained webservice stubs. We've fixed the bug so I'll not...
1
by: Joe | last post by:
Hello All: I am writing a function which accepts an ArrayList as its parameter and converts the contents of the ArrayList into an XmlNodeList. The ArrayList will contain one of several...
18
by: Sam | last post by:
Hi All I'm planing to write an application which allows users dynamically add their points (say you can add upto 30,000) and then draw xy graph. Should I use an array for my coordinate point...
3
by: Justin | last post by:
Here's a quick rundown of what I'm doing. I'm filling an arraylist with data. Then I loop through a dataset and grab a field to perform a search on the arraylist. Every time I find a match I...
2
by: =?Utf-8?B?UGhpbA==?= | last post by:
I have two threads that access an ArrayList. One thread will store new entries. The other thread will retrieve the entries and then remove them from the list. Is this a thread-safe operation...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.