摘要: Reflection 是Java被視為動態(或準動態)語言的一個關鍵性質。這個機制允許程序在運行時透過Reflection APIs取得任何一個已知名稱的class的內部信息,包括其modifiers(諸如public, static 等等)、superclass(例如Object)、實現之interfaces(例如Cloneable),也包括fields和methods的所有信息,并可于運行時改變fields內容或喚起methods。本文借由實例,大面積示范Reflection APIs。
閱讀全文
摘要: Polymorphism shouldn't be a new concept to anybody. You deal with it every day in the real world. There's more than one class of cat to skin, but you skin 'em the same way, even if the specific instance is completely new to you. Let's say for example you want to fuck a hole. You fuck all holes the same. You don't care if that hole happens to be a mouth, an ass, or a pussy, you're gonna fuck it the same way regardless. However, the mouth, pussy, or ass may respond differently to the fucking.
閱讀全文