3 type inner class

xiaoxiao2021-03-06  75

1. General Inner ClassClass AAAA {Class InnerClass {// Write Codes Here}} 2, Method Local Inner Classlocal Class is a class of Class to define within Method, its Scope In this Method 3, Anonymous Inner Class a form: Return New Destination {// inner class}; another form: SomeMethod (new someclass () {// code}); [Note] (1) Anonymous Nested Class must import an interface or Extend a Class, but not IMPLEMENTS or Extends Keywords (2) Anonymous Class cannot declare constructor (3) can declare instance initializer to do initial value settings

转载请注明原文地址:https://www.9cbs.com/read-95054.html

New Post(0)