Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Java Basics
|
Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 18th, 2012, 05:39 PM
Registered User
 
Join Date: Apr 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Question dynamic arrays[First]

Hi, i am working on a project for school, i need to create a dynamic array that will expand as data is added to it. I am trying to get the Fibonacci series added to the list. here is my code:

Code:
import java.util.*;

class fibo
{
   public static void main(String[]args)
   {
              ArrayList numbers =new ArrayList();
              numbers.size();
              numbers.add(0);
              numbers.add(1);
              {
                for(int x=2; x<20; x++;)
                {         
                                ArrayList numbers(x)=numbers(x-2)+numbers(x-1);
                                System.out.println(numbers(x));                
                         }}}}
I was wondering if any one would help....

Last edited by sasoo7; April 18th, 2012 at 05:41 PM.. Reason: Forgot the [CODE] Markers





Similar Threads
Thread Thread Starter Forum Replies Last Post
help writing dynamic form data to dynamic table ublend SQL Server ASP 1 June 1st, 2007 08:09 AM
help writing dynamic form data to dynamic table ublend Classic ASP Professional 1 June 1st, 2007 08:08 AM
Try-Catch Method for Dynamic Arrays DuncanM Visual C++ 1 September 14th, 2006 12:11 PM
Multidemmesional Arrays OR arrays gmoney060 Classic ASP Basics 3 November 1st, 2004 03:42 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.