This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.

The .lang classes for J2ME is a smaller subset of the full J2SE. The Math class is one of them, since MIDP 1.0 did not have support for floating points, methods of the Math classes were removed. random() was one such method. I think it might be back in for MIDP 2.0, but I don't have the API completely memorized.

Nope, just checked Mr. Knudsen's book and there is no random method in the Math class for J2ME. Sorry.

Mark, I think WTK 2.1 supports MIDP 2.0 and the original poster is using WTK 2.1... So it should be able to compile... Or is he choosing MIDP 1.0 as its profile, when he created the project?

Co-author of SCMAD Exam Guide, Author of JMADPlus SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0

Don't get me started about those stupid light bulbs.