带有示例的 Scala Char min() 方法
min()方法用于查找两个指定字符中的最小值。
Method Definition: def min(that: Char): Char
Return Type: It returns the character with the minimum value.
示例:1#
// Scala program of min()
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying min() method
val result = ('F').min('A')
// Displays output
println(result)
}
}
输出:
A
示例:2#
// Scala program of min()
// method
// Creating object
object GfG
{
// Main method
def main(args:Array[String])
{
// Applying min() method
val result = ('a').min('A')
// Displays output
println(result)
}
}
输出:
A