インターフェースについてはかなり基本的な質問がありますが、私もかなり新しいものです。私は通常、オーバーロードされたコンストラクターを使用してクラスをインスタンス化します。私は今、インターフェースを使おうとしていますが、コンストラクターにどのようにデータを入力するのか疑問に思っています。インターフェイスでsetSomeMethod(arguement1、arguement2)のようなものを使用して、属性を設定しますか?
また、サービスインジェクションで「Tapestry5」フレームワークを使用していることにも注意してください。例
public class Main {
    @Inject
    private Bicycle bicycle;
    public Main() {
         //Not sure how to pass constructor variables in
         this.bicycle();
    }
}
インターフェース
public interface bicycle {
   public void someMethod(String arg1, String arg2);
}
実装クラス
public class MountainBike implements bicycle {
   private String arg1;
   private String arg2;
   public MountainBike() {
       //Assuming there is no way to overload this constructor
   }
   public void someMethod(String arg1, String2 arg2) {
       this.arg1 = arg1;
       this.arg2 = arg2;
   }
} 
では、拡張クラスをどのように処理しますか?拡張クラスコンストラクターにデータを設定する方法がわかりません。
public class MountainBike extends BicycleParts implements bicycle {
   private String arg1;
   private String arg2;
   public MountainBike() {
       //Assuming there is no way to overload this constructor
       //Not sure where to put super either, but clearly won't work here. 
       //super(arg1);            
   }
   public void someMethod(String arg1, String2 arg2) {
       this.arg1 = arg1;
       this.arg2 = arg2;
       //Assuming it doesn't work outside of a constructor, so shouldn't work 
       //here either.   
       //super(arg1);
   }
} 
public class BicycleParts {
    private String arg1;
    public void BicycleParts(String arg1) {
        this.arg1 = arg1;
    }
}
前もって感謝します。