Wherever you're tempted to copy code from one class to the next, stop and consider how you can use class hierarchies to leverage similar or identical functionality.
无论何时,如果想将代码从一个类复制到下一个类中,请停下来并考虑如何使用类层次结构利用类似功能或相同功能。
To accomplish this, create a ListBox widget class similar to the one created earlier for TextField, and then add select() and find() methods to it.
要完成这项操作,需要创建 ListBox 窗口小部件类,创建过程与前面创建 TextField 的相似,然后将 select() 和 find() 方法添加到该类中。
Every Joda class has a constructor, similar to this one, where you specify all of the fields that the Joda class can hold.
每一个joda类都有一个与此类似的构造函数,您在此构造函数中指定joda类可以包含的所有字段。
应用推荐