0

What are the different constructors of ArrayList?

Jun 16, 2020 in Kotlin by Anusha

1 answers to this question.

0

There are three different types of constructors of ArrayList in kotlin they are:

Constructor  

Description 

ArrayList(capacity : Int)

We can create the ArrayList of our required capacity by using this constructor.  

ArrayList()

By using this constructor, we can create an empty list.

ArrayList(elements : Collection

By using this constructor, we can create an ArrayList filled by the elements of the collection.

Jun 16, 2020 answered by Sowjanya

Related Questions

0 1 answers

Kotlin Lambda Example

Explain about kotlin lambda expression with example?

Jun 16, 2020 in Kotlin by Irshad
0 1 answers

Kotlin Abstract Class

What is the abstract class in kotlin?

Jun 16, 2020 in Kotlin by Irshad
0 1 answers

Kotlin Default Arguments

How the default argument in kotlin works?

Jun 16, 2020 in Kotlin by Irshad