Set creation (setOf, mutableSetOf)
📖 Scenario: You are organizing a small party and want to keep track of unique guests who have confirmed their attendance.
🎯 Goal: Build a Kotlin program that creates a set of guest names using setOf and a mutable set using mutableSetOf.
📋 What You'll Learn
Create an immutable set of guest names using
setOfCreate a mutable set of guest names using
mutableSetOfAdd a new guest to the mutable set
Print both sets to see the guests
💡 Why This Matters
🌍 Real World
Sets are useful to keep track of unique items like guest lists, product IDs, or tags without duplicates.
💼 Career
Understanding sets helps in data processing, filtering duplicates, and managing collections efficiently in software development.
Progress0 / 4 steps