http://www.theserverside.com/news/1321158/A-beginners-guide-to-Dependency-Injection”>beginners Guide to Dependency Injection 我遇到了一些新的建筑,我确信,我完全理解:
// Instantiate CabAgency, and satisfy its dependency on an airlineagency.
Constructor constructor = cabAgencyClass.getConstructor
(new Class[]{AirlineAgency.class});
cabAgency = (CabAgency) constructor.newInstance
(new Object[]{airlineAgency});
什么是<条码>新等级[]{字典> 实际含义如何?
I understand that its goal is to create a Constructor
instance for AirlineAgency.class
but how does the syntax new Class[]{}
achieve this?
当只有一个物体时,为什么阵列概念[]
?
The What is the {}
syntax here? 为什么没有<代码>(?