DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Java (http://www.daniweb.com/forums/forum9.html)
-   -   Array String (http://www.daniweb.com/forums/thread160657.html)

ITlang007 Dec 4th, 2008 1:15 am
Array String
 
Hi everybody, I'm really new to java and I'm not sure how to do this,

//Create an ArrayList of String type to hold first names of the students

I created mine like this....
ArrayList<String> first = new ArrayList<String>();

stephen84s Dec 4th, 2008 1:35 am
Re: Array String
 
Add some functionality, Compile it and run it and see if it behaves as you want.
Why do want our stamp of approval on it, its not like the world would come to an end if you get a compile error or a wrong output while trying out different combinations for a solution, you might end up discovering a lot more of the Java language that way.

BTW yes that is correct.

ITlang007 Dec 4th, 2008 2:38 am
Re: Array String
 
Thanks man, yea that is true but I'm making sure because it is my assignment.

javaAddict Dec 4th, 2008 3:55 am
Re: Array String
 
Quote:

Originally Posted by ITlang007 (Post 749887)
Thanks man, yea that is true but I'm making sure because it is my assignment.

Can't you compile ti and run it?
Also try to add some elements in the ArrayList and then use a for loop to print them.
Do you know how to find the API for the ArrayList?

verruckt24 Dec 4th, 2008 5:09 am
Re: Array String
 
There's no better way to explore and understand the Java language then to go through the javadocs, it helps you tremendously (Thats my opinion ;-))

stultuske Dec 4th, 2008 7:09 am
Re: Array String
 
Quote:

Originally Posted by verruckt24 (Post 749982)
There's no better way to explore and understand the Java language then to go through the javadocs,

there is off course the coding-the-damn-thing and the trying-the-crap-out approach, which, in combination with reading the api's, does a lot more than just reading it :)

ITlang007 Dec 4th, 2008 10:26 am
Re: Array String
 
I would, but I'm still not done with the program, I will let you guys know as soon as I'm done with it. I appreciate all the help


All times are GMT -4. The time now is 5:24 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC