public class InterfaceManager
    {
       private static IVehicleCommunicationCtrl _bizCtrl = null;//为什么要定义方法的引用?不定义不是也可以访问方法么?
       private static IGpsReceiveCtrl _gpsCtrl = null;       public static IVehicleCommunicationCtrl GetVehicleCommunicationCtrl() //接口中定义静态方法有什么好处?
        {...}
       public static IGpsReceiveCtrl GetGpsReceiveCtrl()
         {...}    }

解决方案 »

  1.   

    public static IVehicleCommunicationCtrl GetVehicleCommunicationCtrl() 
    {
     if (_bizCtrl == null)
                    {
                        _bizCtrl = new VehicleCommunicationCtrlClass();
                    }
    }
      

  2.   

    good good study,day day up
      

  3.   

    public class InterfaceManager
    {
         private static IVehicleCommunicationCtrl _bizCtrl = null;
         public static IVehicleCommunicationCtrl GetVehicleCommunicationCtrl() 
         {
            if (_bizCtrl == null)
            {
            _bizCtrl = new VehicleCommunicationCtrlClass();
             }
          }
    }那这样写有什么用么?