Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Question: When to use closures? So what are closures good for?
Answer:

Closures can be used to avoid global values and provide data hiding, and can be an elegant solution for simple cases with one or few methods.

However, for larger cases with multiple attributes and methods, a class implementation may be more appropriate.

Is it helpful? Yes No

Most helpful rated by users:

©2025 WithoutBook