The first set of enclosing braces delineates the construction of an anonymous inner class, and the second set delineates the instance initializer for the anonymous inner class.
第一组闭合括弧划定一个匿名内部类的构造,第二组划定匿名内部类的实例初始化语句块。
For example, the semantics of return, break, and this are different in a block of code than they are in a Runnable (or other inner class instance) that represents the same block of code.
比如,return、break和this在某一代码块中的语义与其在Runnable(或其他内部类实例)中同一代码块中的语义是不同的。
You are returning an instance of JsonRecordWriter, an inner class that will get a line of data from Listing 3 and produce a line of data in Listing 4.
您正在返回一个JsonRecordWriter实例,这是一个内部类,用于从清单3获取数据并生成清单4中的一行数据。
This feature is richer than function Pointers because it allows the inner class instance to retain a reference to the environment in which it was created.
该特性比函数指针更强大,因为它允许内部类实例保持对创建它的环境的引用。
Inner classes can refer to mutable instance fields if the inner-class expression occurs in an instance context, but this is not the same thing.
如果内部类表达式出现在某个实例上下文中的话,内部类可以引用可变的实例域instance field,但这不是同一回事。
The only thing a class needs to be used this way is a default constructor (which allows you to create an anonymous inner class instance inheriting from your class).
惟一需要以这种方式使用一个类的是一个默认构造函数(它允许您创建继承自类的一个匿名内部类)。
The only thing a class needs to be used this way is a default constructor (which allows you to create an anonymous inner class instance inheriting from your class).
惟一需要以这种方式使用一个类的是一个默认构造函数(它允许您创建继承自类的一个匿名内部类)。
应用推荐