How to check if list is empty in Scala

1 Answer

0 votes
object O {
    def main(args: Array[String]): Unit = {
        val lst = List("scala", "c", "c++", "java", "php") 
  
        println(lst.isEmpty) 
    }
}
    
     
     
     
/*
run:
     
false
 
*/

 



answered Sep 8, 2020 by avibootz
...