Constructor References

Java-Constructor References

Constructor References It is also possible to create references to constructors. This is the general form of the syntax that you will use : className::new. This reference can be assigned to any functional interface reference that defines a method compatible with the constructor. For example, in the following program, the MyMethod( ) method of MyInterface returns a reference of … Read more…