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 139 views
1 answer 136 views
3 answers 165 views
1 answer 124 views
1 answer 132 views
1 answer 151 views
...