object Main {
def main(args: Array[String]) {
val sites = Map("w3xue" -> "//www.w3xue.com",
"baidu" -> "http://www.baidu.com",
"taobao" -> "http://www.taobao.com")
if( sites.contains( "w3xue" )){
println("w3xue 键存在,对应的值为 :" + sites("w3xue"))
}else{
println("w3xue 键不存在")
}
if( sites.contains( "baidu" )){
println("baidu 键存在,对应的值为 :" + sites("baidu"))
}else{
println("baidu 键不存在")
}
if( sites.contains( "google" )){
println("google 键存在,对应的值为 :" + sites("google"))
}else{
println("google 键不存在")
}
}
}