
上QQ阅读APP看书,第一时间看更新
The parameter for setDriver
The next example shows how to pass Map into the setDriver method using the varargs parameter:
// first, create a map for the key:value pairs to pass into the driver
Map<String, Object> preferences = new HashMap<String, Object>;
// then put the key:value pairs into the map
preferences.put("applicationCacheEnabled",false);
preferences.put("network.cookie.cookieBehavior", 0);
// then, pass the map into the setDriver method
CreateDriver.getInstance().setDriver("firefox",
"Windows 10",
"local",
preferences);