Окно насмешки с синонами, мокко, ферментом и реагентом

Можете ли вы инкапсулировать связанные параметры внутри объекта?

, например, если параметры похожи на


MyClass(String house, String street, String town, String postcode, String country, int foo, double bar) {
  super(String house, String street, String town, String postcode, String country);
  this.foo = foo;
  this.bar = bar;

, тогда вы могли бы иметь:


MyClass(Address homeAddress, int foo, double bar) {
  super(homeAddress);
  this.foo = foo;
  this.bar = bar;
}

13
задан DimlyAware 11 June 2016 в 05:24
поделиться