•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 456,518 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,812 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 1969 | Replies: 4
![]() |
Just read the API for ArrayList. The methods are quite clear. If you don't understand Collections at all, there is a lot of info here: Java Collections Framework
•
•
Join Date: Oct 2007
Posts: 8
Reputation:
Rep Power: 0
Solved Threads: 1
before you move to the API i guess you need to really get a hold on what an array is, if i may put it in any way an array is just a contiguous memory for similar data types and almost all programming languages support array in java you have to declear an array using the SYNTAX;
datatype [] objectname;
where datatype may be any of the primitve data types or an object,
eg;
int [] x;
String [] name;
the next thing is for you to initilize the size of the array after which these is done with the syntax
objectname= new [integer_value_of size];
eg.
x= new int[10];
name= new String [25];
you can now assing a value to each index in the array
x[0]=34;
x[1]=45;
x[2]=19;
x[3]=49;
x[4]=38;
NOTE :-the index goes from 0 to n-1, n which is the size of the array itself can not be used
datatype [] objectname;
where datatype may be any of the primitve data types or an object,
eg;
int [] x;
String [] name;
the next thing is for you to initilize the size of the array after which these is done with the syntax
objectname= new [integer_value_of size];
eg.
x= new int[10];
name= new String [25];
you can now assing a value to each index in the array
x[0]=34;
x[1]=45;
x[2]=19;
x[3]=49;
x[4]=38;
NOTE :-the index goes from 0 to n-1, n which is the size of the array itself can not be used
•
•
Join Date: Nov 2004
Location: Netherlands
Posts: 5,752
Reputation:
Rep Power: 19
Solved Threads: 200
if you don't understand the question, don't try to answer. Array != ArrayList as you would have known had you read the documentation (but then, you tell people they shouldn't read the documentation and you clearly have followed your own advise...).
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Java Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
access activation api blogger blogging blogs code com combo dani daniweb data debugging development dreamweaver dropdownlist gdata google gpl html innovation java key linux microsoft microsoft sdk for java microsystems module net news open openbsd platform product programming reuse rss serial software source sun tags vista web wysiwyg xml
- huffman code (C++)
- I Need Sample ASP.NET Code (ASP.NET)
- My Sample C++ Code (C++)
- Flash action script sample code and tutorial (Graphics and Multimedia)
- Something wrong with my code, why Junk character appears? (C)
- anyone has a text-to-braille coding sample? (Java)
- CD Burner code in VC++ (Visual Basic 4 / 5 / 6)
- Linked arraylist (Java)
Other Threads in the Java Forum
- Previous Thread: hi i need coding of this question can any body help me
- Next Thread: password authentication




Linear Mode