当前位置:首页 » 编程博文
开发技术指南» 文章正文
    引言: WHAT 什么是继承?WHY 为什么要用继承?(继承有什么用?继承有什么优点?)HOW 怎么使用继承?WHEN,WHERE 什么时候,什么地方使用继承?IF NOT 如果不使用继承,能否实现同样的设计,如果可以两个方案的区别又在什么地方what?继承是一个动词,相对与接口这一名词,理解上应该有所...
 

 

    摘要:转:[ 分享] 我收集的ebook。自己肯定是看不完的,收集是为了给用的到的朋友。 http://www.itpub.net/259894.html ......
 ·java中容易搞错的一些东东    »显示摘要«
    摘要:1)instanceof:实现了某接口的类的对象也是该接口的实例;某类的对象也是该类超类的实例。 2)native()修饰的方法没有方法体,用一个分号";"代替大括号。 3)main不是关键字。 4)system.exit(int value),也就是说,只要是int的,就能够使jvm退出system.exit(´a´);同样的是合法的。 5)&......


继承学习
上一页   ...      ´ add code to remove a customerinfo item from the list.

    end function 【程序编程相关:VC数字图像处理编程讲座之五

【推荐阅读:VC数字图像处理编程讲座之四

【扩展信息:用VC实现小型矢量图形系统的开发

   function getnextcustomer as customerinfo

      ´ add code to get the next customerinfo item from the list.

   end function

   function getprevcustomer as customerinfo

        ´add code to get the previous customerinfo item from the list.

   end function

end class

应用程序可能还有一个类似的产品列表,这些产品是用户已添加到购物车列表中的,如下面的代码片段中所示:

class shoppingcartitem

   public previousitem as shoppingcartitem

   public nextitem as shoppingcartitem

   public productcode as integer

   function getnextitem as shoppingcartitem

      ´ add code to get the next shoppingcartitem from the list.

   end function

end class

此处可以看到一种模式:两个列表行为相同(插入.删除与检索),但对不同的数据类型进行操作.维护两个代码库以基本执行同一功能是自寻烦恼.最有效的解决方案是将列表管理析解到其自己的类中,然后对不同的数据类型从该类继承:

class listitem


...   下一页
    摘要:you can switch between the sun java™ virtual machine and the microsoft vm. the sun jvm can be enabled and disabled without having to uninstall it. switching back and forth between these virtual ......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE