import scala.collection.mutable
//特点:元素要唯一
object Test24 {
def main(args: Array[String]): Unit = {
//1.定义set
//val set1=Set[元素的类型】(元素1,元素2)
//元素的类型可以省略
// val set1=Set[String]("小花","小明","小明")
// val set1=Set("小花","小明","小明")
//println(set1)
// 不可变Set,默认使用的set就是不可变的!
// val course=Set("语文","数学")
// val course1=course+"英语"
// println(course,course1)
// 可变set,需要额外去引入包
val course = mutable.Set("语文","数学")
println(course)
//2.添加
course += "英语"
println(course)
}
}