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

Creating an ArrayList

Good day,

Firstly I feel I must apologise, I understand that what I'm about to ask may appear to frustrate some of you who may be more experienced, however, I just don't have a clue, I can't get my head around Java, I've tried, I've read books, attended lectures and surfed the net... I just don't get it.

On to my question.

my understanding creating an arraylist is as follows

ArrayList<NAME> MyList = new Array List <NAME>));

yet when I input this in my programme my compiler said t was incorrect.
Sep 18 '07 #1
3 4257
JosAH
11,448 Expert 8TB
Good day,

Firstly I feel I must apologise, I understand that what I'm about to ask may appear to frustrate some of you who may be more experienced, however, I just don't have a clue, I can't get my head around Java, I've tried, I've read books, attended lectures and surfed the net... I just don't get it.

On to my question.

my understanding creating an arraylist is as follows

ArrayList<NAME> MyList = new Array List <NAME>));

yet when I input this in my programme my compiler said t was incorrect.
What happens if you do this instead?

Expand|Select|Wrap|Line Numbers
  1. ArrayList<NAME> MyList = new ArrayList<NAME>();
  2.  
Assuming that NAME is a type by itself. Think of a type name such as List or
ArrayList followed by a <type> as a specialized type, i.e. only 'type' things are
accepted as elements of the List or ArrayList.

kind regards,

Jos
Sep 18 '07 #2
r035198x
13,262 8TB
Good day,

Firstly I feel I must apologise, I understand that what I'm about to ask may appear to frustrate some of you who may be more experienced, however, I just don't have a clue, I can't get my head around Java, I've tried, I've read books, attended lectures and surfed the net... I just don't get it.

On to my question.

my understanding creating an arraylist is as follows

ArrayList<NAME> MyList = new Array List <NAME>));

yet when I input this in my programme my compiler said t was incorrect.
Because it is incorrect. You should probably burn all your books and put your lecturers on the defenestration list. They all taught you the wrong things. Get the tutorial pointed to by this page and read that.

P.S I'll have to rename this thread to something more appropriate.
Sep 18 '07 #3
Good day,

Firstly I feel I must apologise, I understand that what I'm about to ask may appear to frustrate some of you who may be more experienced, however, I just don't have a clue, I can't get my head around Java, I've tried, I've read books, attended lectures and surfed the net... I just don't get it.

On to my question.

my understanding creating an arraylist is as follows

ArrayList<NAME> MyList = new Array List <NAME>));

yet when I input this in my programme my compiler said t was incorrect.

NAME must be a type.
Sep 19 '07 #4

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

Similar topics

0
by: DotNetJunkies User | last post by:
Hie, I create a dynamique HtmlTable, in each cell of this HtmlTable put a new control ( dropdownlist,label,..) and then want to create handler so that if i change the select item in the dop downlist...
1
by: Stephen | last post by:
I have a really annoying problem with a datagrid. I have an application which populates a datagrid on the onclick event of a button. The datagrid is bound to an ArrayList which holds the values. ...
5
by: Netmonster | last post by:
Hello, Does any one have an example of how to create an ArrayList of objects? i.e. ArrayList of ArrayLists or an ArrayList of Hashtables? Thanks in advance KC
3
by: ZeroVisio | last post by:
Hi, Is it possible to create two -dimensional array using ArrayList in C#? I know you can do one-dimensional array but i dont know how to do two-dimensional. in my case my number of columns...
9
by: Patrick.O.Ige | last post by:
I have a code below and its a PIE & BAR CHART. The values now are all static but I want to be able to pull the values from a database. Can you guys give me some ideas to do this? Thanks ...
0
by: msnews.microsoft.com | last post by:
Hello All, I created a control and it is not showing up in my Web Page? I am new to this. Can somebody please explain what I am doing wrong. Thanks Anand Ganesh Here is my control code....
5
by: Adam | last post by:
Hi all, I need to create a bunch of class instances as myapp runs, but I want to avoid code like this: Dim oUser1 as new User Dim oUser2 as new User Dim oUser3 as new User Dim oUser4 as new...
12
by: garyusenet | last post by:
I have had no replies to my previous post so perhaps I didn't write it good enough. Please excuse new thread but i wanted to break from the last thread hopefully this thread will be better. ...
11
by: Matthew Wells | last post by:
Hello. I have figured out how to create an instance of an object only knowing the type by string. string sName = "MyClassName"; Type t = Type.GetType(sName); Object objNew =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
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.