簡體   English   中英

Java -- 列表<Class>方法名

[英]Java -- List<Class> methodname

撓頭想弄清楚這里的情況......

SwProductInstanceView -- List<SwProductInstanceView > listAll()是什么意思? 通過將類放在列表中 - list(all) 它是否從 SwProductInstanceView 調用任何對象? 或者它增加了一個可以在以后使用的新方法?

界面 -

public interface SwProductInstanceService {

List<SwProductInstanceView> listAll();

類 - SwProductInstanceView

public class SwProductInstanceView {
private String swProduct;
private String swProductModule;
private String instanceName;

public SwProductInstanceView(String swProduct, String swProductModule, String instanceName) {
    this.swProduct = swProduct;
    this.swProductModule = swProductModule;
    this.instanceName = instanceName;
}

那是接口中的一個方法,沒有任何實現。 然后,您將擁有該接口的一個或多個實現,這些實現需要為此類方法提供實現。 這意味着“或者它增加了一個以后可以使用的新方法?” 是一種很好的表達方式。 這基本上是公開一個方法,然后可以由SwProductInstanceService接口的任何使用者SwProductInstanceService

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM