我在 IBM 页面上寻找 .NET 的一些文件网示例代码,我发现了这个:
namespace CESample
{
// Represents the connection with the Content Engine.
public class CEConnection
{
private IDomain domain;
private IObjectStoreSet ost;
private ArrayList osNames;
private String domainName;
private bool isCredentialsEstablished;
// Constructor
public CEConnection()
{
domain = null;
ost = null;
osNames = new ArrayList();
domainName = null;
isCredentialsEstablished = false;
}
//... other methods
没关系,在创建对象时始终将每个变量设置为空?那么 bool 和 new ArrayList() 怎么样?我们应该这样做吗?将布尔值始终设置为假?