title: Defining methods in Java
body: <p>I just got an assignment back, which was marked down due to the following method definition:</p>
  
  <pre><code>static String[] getDayData (int day) {
  </code></pre>
  
  <p>I was told: </p>
  
  <blockquote>
    <p>Your functions should <em>always</em> have the definer <code>public</code>/<code>private</code>/<code>protected</code> in them.</p>
  </blockquote>
  
  <p>Despite the fact that I disagree with the function part in Java, It clearly states <a href="http://docs.oracle.com/javase/tutorial/java/javaOO/methods.html" rel="nofollow">here</a> that: </p>
  
  <blockquote>
    <p>The only required elements of a method declaration are the method's return type, name, a pair of parentheses, <code>()</code>, and a body between braces, <code>{}</code>.</p>
  </blockquote>
  
  <p>So who has any thoughts on this? Should I always include a modifier in the method's definition or not?</p>