Java Reference
In-Depth Information
The function will take a number of years and return a number of seconds as
a long (an extra-big int ). We'll cheat a bit to make this easy, and convert years
to seconds. (See the footnote if you need a hint.) 4
You'll add this new function to the Simple plugin, and call the function to print
out its value just like we did with your name and age.
Define the function where the top arrow is pointing:
And add the call to the function howlong down where my cursor is, at the second
arrow. Assign it to an extra-big integer (a long ) and pass in an age (I'll use 10
here) like this:
long secondsOld = howlong(10);
Then print it out to the player just like the rest of the chat() calls do.
In other words, multiply the number of years by the number of days in a year, multiplied
by the number of hours in a day, multiplied by the number of minutes in an hour,
and finally by the number of seconds in a minute.
Search WWH ::

Custom Search