Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,160,489 members, 7,843,487 topics. Date: Wednesday, 29 May 2024 at 06:41 AM

Problems With Threads And Arrays - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Problems With Threads And Arrays (714 Views)

Learning Java Algorithms:merge Equal And Unequal Arrays. / Coding Challenge 6: Working With Arrays / I Need Help With Arrays In C (2) (3) (4)

(1) (Reply)

Problems With Threads And Arrays by unklelouis: 1:47am On Apr 08, 2010
Hi, i'm working on this project. I'm trying to create an array of objects. But i can't seem to call the start() method when i get an element from the array. Please look and Help. The line highlighted in red is the one causing problems. thanks

if (cardi == 1) {
                int i = 0;
                Random rand = new Random();
                int position  = rand.nextInt(3);

                Object [] digitArray = new Object[5];

                DodigitsEnglish digitEnglish = new DodigitsEnglish();
                DodigitsFrench digitFrench = new DodigitsFrench();
                DodigitsGerman digitGerman = new DodigitsGerman();

                digitArray[i] = digitEnglish; i++;
                digitArray[i] = digitFrench; i++;
                digitArray[i] = digitGerman; i++;

                Object dodigit = (Runnable)digitArray[position];
               
                new dodigit.Start();

}
Re: Problems With Threads And Arrays by Seun(m): 4:04am On Apr 08, 2010
That's why Java developers always use an IDE.   Thread.start() is not capitalized.

(1) (Reply)

I Need A Tutor In Web Design And Other Related Programme In Lagos. / Anybody Wanna Help Make A Game (java Or C# Programmers) / Affordable /professional Websites For Those Starting Out In Business!

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 7
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.