title: Static methods in java interface
body: <p>As far as I know you cannot declare static methods in interface body. However, accidentally I found peculiar piece of code on <a href="http://docs.oracle.com/" rel="noreferrer">http://docs.oracle.com/</a> site. Here is the <a href="http://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html" rel="noreferrer">link</a></p>
  
  <p>Namelly </p>
  
  <pre><code>public interface TimeClient 
  {
  void setTime(int hour, int minute, int second);
  void setDate(int day, int month, int year);
  void setDateAndTime(int day, int month, int year,
                             int hour, int minute, int second);
  LocalDateTime getLocalDateTime();
  
  static ZoneId getZoneId (String zoneString) {
      try {
          return ZoneId.of(zoneString);
      } catch (DateTimeException e) {
          System.err.println("Invalid time zone: " + zoneString +
              "; using default time zone instead.");
          return ZoneId.systemDefault();
      }
  }
  
  default ZonedDateTime getZonedDateTime(String zoneString) {
      return ZonedDateTime.of(getLocalDateTime(), getZoneId(zoneString));
      }
  }
  </code></pre>
  
  <p>this <code>interface</code> has a <code>static</code> method <code>getZoneId</code></p>
  
  <p>I am lost... could anyone explain please</p>