On the Android dev page, in the Dagger section,
NetworkModule.class in Java code is written as [NetworkModule::class] in Kotlin code.
I thought
NetworkModule.classin Java should beNetworkModule::class.javain Kotlin, isn't it?why use the square brackets(
[])? I think it's the same asget, but why do we need it?
I was reading this: https://developer.android.com/training/dependency-injection/dagger-android#java
In the 'Dagger Modules' section,
Java code:
@Component(modules = NetworkModule.class)
public interface ApplicationComponent {
...
}
the same code written in Kotlin:
@Component(modules = [NetworkModule::class])
interface ApplicationComponent {
...
}