Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #21 (permalink)  
Old 01-09-2008, 01:50 PM
Member
 
Join Date: Jan 2008
Posts: 12
pringle is on a distinguished road
Another thing, where i've written this:

Case 2: if (!studentContactManager.isEmpty())
{
System.out.println(“Contact Detail List”);
For (int = 0; i < studentContactManager.length; i++);

Am I correct in using 'studentContactManager.length' in order to display each stored contact?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #22 (permalink)  
Old 01-09-2008, 08:21 PM
gibsonrocker800's Avatar
Senior Member
 
Join Date: Nov 2007
Location: New York
Posts: 143
gibsonrocker800 is on a distinguished road
Send a message via AIM to gibsonrocker800
yes because the .length attribute of arrays returns the number of elements in the array. and then, in the for loop, you do i < studentContactManager.length, in which it will iterate through each index of the array (and will never go out of bounds, because you did <. if you put <= it would throw an ArrayIndexOutOfBoundsException at runtime). So good job on that. I can see that you're learning =]
__________________
//Haha javac, can't see me now, can ya?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stuck on Two Questions, Please Help sylo18 New To Java 5 03-11-2008 03:03 AM
2 simple java questions jimJohnson New To Java 2 02-02-2008 11:35 AM
few java questions hiaslpix New To Java 4 01-01-2008 07:47 AM
questions Gilgamesh New To Java 3 11-28-2007 01:18 AM
3 Questions hiranya AWT / Swing 4 11-14-2007 06:57 AM


All times are GMT +3. The time now is 01:34 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org