Computer Science, asked by bhasan1918, 1 year ago

Whats the use by creating an empty immutable list using emptylist()?

Answers

Answered by helsset
0

Solution:

For that it need  a method that takes a List of addresses as a parameter, and can't take null (the List is required as not-null), but there's no addresses to pass, so we have to pass an empty list. Instead of creating yet another empty list to pass, just pass Collections. EmptyList() and it costs nothing.

Thus this is the required answer.

Similar questions