interface

    -2熱度

    3回答

    我有一個接口方法parse(String value),它可能有不同的實現,返回的地圖<String, Integer><String, String>或任何東西。我怎樣才能使這個通用性足以讓我擴展爲不同的返回類型? 目前,我做的: public interface Parser <K,V> { Map<K,V> parse(String document); } 但是,這將使它

    -1熱度

    1回答

    我需要創建一個名爲DynamicSortedSet的類來實現接口java.util.SortedSet。我該如何給它和java.util.TreeSet類一樣的構造函數和方法? 這是我目前有: package aSpecialPriorityQueue; import java.util.SortedSet; import java.util.TreeSet; public class

    0熱度

    2回答

    我有一個片段: public class VertretungsplanTab extends Fragment implements MainActivity.VertDataInterface{ TextView vertretungsView; String LOG_TAG = VertretungsplanTab.class.getSimpleName();

    0熱度

    1回答

    在測試我的一些代碼庫時,我發現使用接口模擬「gopkg.in/mgo.v2」中的對象非常有用。我遇到了一個問題,其中mgo.Query沒有實現我的界面查詢。 import mgo "gopkg.in/mgo.v2" type Collection interface { FindId(interface{}) Query Find(interface{}) Query

    1熱度

    1回答

    在封裝考慮類ArrayList和AbstractList定義java.util中 public class ArrayList<E> extends AbstractList<E> implements List<E>, RandomAccess, Cloneable, java.io.Serializable public abstract class AbstractList<

    0熱度

    1回答

    我想了解接口的繼承是如何工作的。當一個接口繼承另一個接口但具有相同簽名的方法時,編譯器會發出一個警告,提醒基礎成員是隱藏的(這看起來很合理)。但是,當我稍後在一個類中實現子接口時,我必須實現具有相同簽名的父接口方法和子接口方法,這使我感到困惑......我認爲,當父成員隱藏時,只需要實現子接口方法? (我來到這一邊看着IEnumerable和IEnumerable<T>接口) interface

    0熱度

    1回答

    我正在爲一個項目(純控制檯程序)構建一個菜單(界面),並且遇到問題。 第一次我要建一個程序的選項,這樣的巨量,是這樣的: three available options If chosen option 1 then eight another options available If option 2 then six other available options If option 3

    0熱度

    1回答

    我申請資料庫類似於彈簧數據JPA,我只創建一個實體庫的接口: public interface AuthorRepository extends Repository<Author, Long> { } 我這也是庫接口: public interface Repository <T, ID extends Serializable> { List<T> findAll() thro

    -3熱度

    1回答

    我在德爾福的接口掙扎。這個問題可能是微不足道的,但我是Delphi的新手,所以請原諒。我有一個TreeView的自定義節點,其中包含一個對象的接口(本質上,就像這裏提出的:Storing interface pointer inside tree view nodes)。 問題是,一旦我刪除了一個節點(爲了重畫樹形視圖)並將接口變量設置爲零(釋放不會出於某些原因,接口出於某種原因,我還沒有完全理解

    -2熱度

    2回答

    這可能有點愚蠢的問題,但我對Lamda表達式和一般編程新手。 與Lambda表達式嘗試周圍像這樣經過: interface Starter { public void start(); } class Machine { public void run(Starter s) { System.out.println("Running code...."); s