How to declare a constant string in Scala

1 Answer

0 votes
object Main extends App {
  val constantString: String = "abc"
  
  println(constantString)
}


 
/*
run:

abc

*/

 



answered Jun 19, 2025 by avibootz

Related questions

...