The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
January 2002

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

Arrays in my French program

Posted by Chloe on January 21, 2002 at 10:53 AM

In a French learning program I'm writing I've got a bit of code like this:

---------------------------------------------------------------

String[][] words = {{"Hello", "Bonjour"},
{"Goodbye", "Au revoir"},
{"Yes", "Oui"},
{"No", "Non"}};

int numberOfWords = 4;

---------------------------------------------------------------

Should I want to add more words, I also have to change the value of numberOfWords (there is a part later in the program where it needs to know how many words there are). Is there any way of automatically finding out how many there are, without me having to manually change it?



Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us