变量名前的Kotlin星号运算符或Kotlin中的Spread运算符
我想知道在Kotlin中变量名之前星号到底是做什么的。我*args在Spring boot Kotlin示例中看到了这个(): @SpringBootApplication open class Application { @Bean open fun init(repository: CustomerRepository) = CommandLineRunner { repository.save(Customer("Jack", "Bauer")) repository.save(Customer("Chloe", "O'Brian")) repository.save(Customer("Kim", "Bauer")) repository.save(Customer("David", "Palmer")) repository.save(Customer("Michelle", "Dessler")) } } fun main(args: Array<String>) { SpringApplication.run(Application::class.java, *args) }