title: Accessing a static method of type T from within a generic class
body: <p>I'm new to generics, and am struggling with applying to my situation:</p>
  
  <p>I currently have several SyncData Classes, one for each object type that I wish to sync. I'm looking at changing this to a single generic class SyncData. Within this class some parts of the code will use objects of type T, but I'd also like to reference static Methods of type T. This would enable me for example to specify a notification action (specific to the data type) to be called on completion of the sync.</p>
  
  <p>I'm getting myself caught in a loop: to access the methods I need to define an interface that all the types will implement, in the generic T extends interface, and then I can reference the relevant methods of type T within my generic SyncData Class. However I can't specify a static method in an interface, and because I can't in the interface, I cant access it in my generic SyncData Class.</p>
  
  <p>I've looked at various tutorials, questions here etc, maybe I'm missing the obvious, but I can't see the way forward - everything that comes up seams to refer to different issues with generics and static nethods. Any advice would be very much appreciated.</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>As requested some sample code added to illustrate what I tried to do (I'm actually looking to use static methods at various other points within the code, but this illustrates the point).</p>
  
  <p>Is it possible to access the static method of class T from within the SyncAction class (without making T extend DataType1 by which point there is no point using generics as T cannot be DataType2)?</p>
  
  <pre><code>public interface Syncable {
      //following needed or I can't access onSyncComplete in SyncAction
      public void onSyncComplete();
  }
  
  public class DataType1 implements Syncable {
      //constructor etc removed as irrelevant to question
  
      //Eclipse warns 'this static method cannot hide instance method from Syncable' 
      public static void onSyncComplete(){
          //do stiff here
      }
  }
  
  public class SyncAction&lt;T extends Syncable&gt;{
      //do all the syncing etc using multiple DataType1 objects
  
      T.onSyncComplete();
  }
  </code></pre>