4 java arrays null constructor
这是代码:
// Default constructor
public Bestellung() {
this(null, null, null);
}
// Initial constructor
public Bestellung(LocalDateTime zeitstempelBestellung, LocalDateTime zeitstempelAuslieferung,
PizzaVO[] warenkorb, int index) {
super();
this.zeitstempelBestellung = zeitstempelBestellung;
this.zeitstempelAuslieferung = zeitstempelAuslieferung;
this.warenkorb = warenkorb;
this.index = index;
}
Run Code Online (Sandbox Code Playgroud)
我想完成默认构造函数。因此我必须将两个 localDateTimes、一个空数组和一个 int 传递给构造函数。如何传递空数组?
如何传递空数组?
new PizzaVO[] { }
Run Code Online (Sandbox Code Playgroud)
顺便说一句,这不是默认构造函数:
public Bestellung() {
this(null, null, null);
}
Run Code Online (Sandbox Code Playgroud)
它是一个无参构造函数。
| 归档时间: |
|
| 查看次数: |
16176 次 |
| 最近记录: |