Ask Your Question
1

What does it mean when a public function in RecyclerView.Adapter exposes its internal return type in Kotlin?

asked 2023-05-03 10:50:23 +0000

lalupa gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2023-05-03 11:20:02 +0000

djk gravatar image

When a public function in RecyclerView.Adapter exposes its internal return type in Kotlin, it means that the function is making its internal implementation details available to external code. This can be useful in some cases, such as when a developer wants to access or modify the data held by the adapter. However, it can also lead to potential problems, such as breaking encapsulation and making the adapter more difficult to maintain. Care should be taken when exposing internal implementation details in public functions to ensure that it is done appropriately and with consideration for the overall design of the code.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-05-03 10:50:23 +0000

Seen: 9 times

Last updated: May 03 '23