思远(BonaShen)博客

朋友们,我有了新了家,就在http://www.bonashen.com

导航

2006年3月13日 #

Interfaces with Constants Only(java中通用常量定义)

摘要: Interfaces with Constants Only Before the static import became available, a trick for avoiding the need to write the class name for static constants was to create an interface whose only purpose is to hold constants. For example, say that you need the constants ALPHA and OMEGA for several different programs. The first option is to create a utility class that holds the constants. e.g.: 阅读全文

posted @ 2006-03-13 11:05 Bona shen 阅读(1327) 评论(1) 推荐(0) 编辑

Interfaces for Callbacks(Java中回调)

摘要: Interfaces for Callbacks A common technique in the C language is to pass a pointer to a function in the argument list of another function. The receiving function can invoke the passed function using the pointer. This approach is referred to as a callback. 阅读全文

posted @ 2006-03-13 10:59 Bona shen 阅读(633) 评论(0) 推荐(0) 编辑