In Java we have the Class::new
syntax for constructor references. I know, there are callable references for methods, but how about constructors? A typical use case for me would be factories.
相关问题
- How to refresh height of a Constrained View in Con
- Android Room Fetch data with dynamic table name
- Access Binding Adapters in multi module project
- How to make request-bound data globally available
- In Vertx I need to redirect all HTTP requests to t
相关文章
- SonarQube: How to suppress a warning in Kotlin cod
- What are the `^let` annotations in Android Studio
- Create Custom Dagger 2 Scope with Kotlin
- Android Studio 3.5 ERROR: Unable to resolve depend
- Kotlin inlined extension property
- Kotlin Koans with EduTools plugin: “Failed to laun
- “lateinit” or “by lazy” when defining global andro
- Convert java to kotlin on paste
You can get a functional instance for constructor by simply using
::ClassName
, as if it were factory function.