Method Practice

We learned about methods in grade 11, but not as well as we should have, so here's some review and practice.

Methods Info

Practice

Make a class called MethodPractice (or something) and then from public static void main() run (or call) the following methods.

Write methods that do the following:

  1. take an int and return its reciprocal as a double
  2. take a string and return the length of the string as an int
  3. take nothing, return nothing, just print "YOLO"
  4. take nothing, return a random number between 1 and 99
  5. take a boolean and an int and return a string
  6. returns a double with the value of NaN or infinity.

    I'd like to see if I can test if a number is equal to NaN or infinity

Use the output of some of these in your main() method.