Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,693 members, 7,955,619 topics. Date: Sunday, 22 September 2024 at 10:57 AM |
Nairaland Forum / Science/Technology / Programming / Problems With Threads And Arrays (733 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)
A Must Read. Very Important / Help!!!what Programs Should Do? / Just Want To Try Out Something
(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. 5 |