title: Understanding Java methods
body: <p>So, I'm very new to Java, I have a summer college course and we're on functions or methods and I'm having a bit of trouble understanding them.  </p>
  
  <p>There is a question on a lab I'm having a little trouble with:</p>
  
  <blockquote>
    <p>"Write a method called MaxOfThree that accepts three integer
    parameters and returns the largest of the three."</p>
  </blockquote>
  
  <p>This is what I have so far but I'm not sure whats wrong.  I added the print statement at the end because I wasn't getting a return value when I ran it but now I'm getting errors and it's not compiling.  If you could help me understand methods a bit more I'd greatly appreciate it.  For instance how the parameters work and calling it and if what's included in the function call is correct and how that works.  I just get so confused when I read through the material and was hoping for an explanation in more layman's terms.  Thanks for any help, here is what I have so far.</p>
  
  <pre><code>public class Test {
  
      public static void main(String[] args) {
          int a = 2, b = 3, c = 4;
          int maxValue = max3(a, b, c);
      }
  
      public static int max3(int a, int b, int c) {
          int max = a;
          if (b &gt; max) max = b;
          if (c &gt; max) max = c;
          return max;
          System.out.println(max);
      }
  }
  </code></pre>
  
  <p>Here are the errors I'm receiving just in case...</p>
  
  <pre><code>Test.java:16: error: unreachable statement
             System.out.println(max);
             ^
  Test.java:17: error: missing return statement
          }
          ^
  2 errors
  </code></pre>