How to get the min and max integer in Scala

1 Answer

0 votes
object IntMaxMin {
  val IntMax: Int = Int.MaxValue
  val IntMin: Int = Int.MinValue

  def main(args: Array[String]): Unit = {
    println(IntMax)

    println(IntMin)
  }
}

 
/*
run:
 
2147483647
-2147483648
 
*/

 



answered May 17, 2025 by avibootz

Related questions

1 answer 151 views
1 answer 147 views
3 answers 183 views
1 answer 134 views
1 answer 140 views
1 answer 159 views
...