Unklelouis's Posts
Nairaland Forum › Unklelouis's Profile › Unklelouis's Posts
1 (of 1 pages)
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(); } |
1 (of 1 pages)