"There are times when the easy things should be quick and easy" [...] "and worry about the theory later" -Fred Hamilton-
SCJA
~Currently preparing for SCJP6
Brian Legg wrote:
You may want to change your name though, the mods will warn you soon enough.
Ernest Friedman-Hill wrote:nobody who knows what they're talking about said that.
"There are times when the easy things should be quick and easy" [...] "and worry about the theory later" -Fred Hamilton-
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
SCJA
~Currently preparing for SCJP6
Thanks Mr. Legg. I feel welcome to theese forums.Brian Legg wrote:I think Java is "relatively" easy
(random numbers) sway your entire opinion of Java.
Give it another shot [...] more visits to these here forums
"There are times when the easy things should be quick and easy" [...] "and worry about the theory later" -Fred Hamilton-
Sergio C. Campos J. wrote:All the example codes I found didn't work when placed in my program.
SCJA
~Currently preparing for SCJP6
David Newton wrote:When Java is your hammer, everything starts to look like a thumb.
SCJA
~Currently preparing for SCJP6
David Newton wrote:IMO Java-the-syntax is easy. It's like hammering--hammering is easy, you just bang on stuff, and it obligingly gets hit.
Learning how to hammer *well* is harder: ever watch a little kid hammer stuff? Heck, even adults manage to smack their own appendages more than seems reasonable. Now take that hammer and imagine there are a million ancillary tools necessary to get work done in the most efficient way possible. That's Java.
When Java is your hammer, everything starts to look like a thumb.
David Newton wrote:
...
It's a matter of time: the Java ecosystem is huge. There are no shortcuts.
John Kimball wrote:For all the API bloat & language quirks, the one thing I can't stand is the standard Calendar/Date APIs.
Good lord, someone really dropped the ball when they came up with that design.
And then there is Java's generics.
Sigh.
Brian Legg wrote:That is alarming! If you have specific examples of code that you could not get to work that you found in the Java Docs/Tutorials you should definately post your code here for review.
"There are times when the easy things should be quick and easy" [...] "and worry about the theory later" -Fred Hamilton-
Sergio C. Campos J. wrote:
Here It is... the whole thing:
Two Errors at line 20:
int Posicion = Aleatorio.nextInt(4536) + 1;
1) cannot be applied to (int)
2) incompatible types
Version 2.2 (25/10/2004 10:21 PM)Henry Wong wrote:
What version of JavaME are you using? The Random.nextInt(int) method is not available for some versions.
"There are times when the easy things should be quick and easy" [...] "and worry about the theory later" -Fred Hamilton-
"There are times when the easy things should be quick and easy" [...] "and worry about the theory later" -Fred Hamilton-
Sergio CamposJ wrote:Well..., I found a solution to generate a random number between 1 and 4536 without using java.util.random
int Position = (System.currentTimeMillis() % 4536) + 1
But I got a new error: possible loss of precision
The error can be fixed changing Position to type long
But I need the variable to be type int
Someone can help?
SCJA
When I die, I want people to look at me and say "Yeah, he might have been crazy, but that was one zarkin frood that knew where his towel was."
"There are times when the easy things should be quick and easy" [...] "and worry about the theory later" -Fred Hamilton-
Sergio CamposJ wrote:Well..., I found a solution to generate a random number between 1 and 4536 without using java.util.random
int Position = (System.currentTimeMillis() % 4536) + 1
Doing a mod on a random number is definitely better than doing a mod on a time value.
"There are times when the easy things should be quick and easy" [...] "and worry about the theory later" -Fred Hamilton-