Constructor Reference for Array

Java-Constructor Reference for Arrays

Constructor Reference for Arrays Another form of the constructor reference syntax that is used for arrays. To create a constructor reference for an array, use the construct : type[ ]::new. Type specifies the type of object being created. For example, the following creates a three-element array of MyClass objects and gives each element an initial … Read more…