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.
3 4257
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? -
ArrayList<NAME> MyList = new ArrayList<NAME>();
-
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
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.
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.
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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. ...
|
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
|
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...
|
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
...
|
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....
|
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...
|
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.
...
|
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 =...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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: 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...
|
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,...
|
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...
|
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...
|
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,...
|
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...
| |