CarDealer类 事件发布程序 using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace DelegateEvent { public class CarInfoEventArgs : EventArgs { public string Car { get; private set; } public CarInfoEventArgs(string car)…
第六章.Android的对象管理 在Java中,不再使用的对象会通过gc机制来自己主动回收.而Android系统执行时库层代码是由C++编写的,在C++中创建的对象通常使用指针来操作,一旦使用不当.轻则造成内存泄漏,重则造成系统崩溃. 只是在Android源代码实现中,它为我们提供了智能指针来对C++对象进行管理.这使得程序猿不再须要关注对象的生命周期.对象是否已经释放. 本章主要内容例如以下: l 智能指针 l RefBase类 l 强指针 l 弱指针 5.1智能指针 在C++代码中创建对象有…
!/usr/bin/python -*- coding: utf-8 -*- """ ZetCode PyQt4 tutorial This example shows three labels on a window using absolute positioning. author: Jan Bodnar website: zetcode.com last edited: October 2011 """ import sys from P…