Home »
Code Examples »
Scala Code Examples
Scala - Implement infinite loop using while loop Code Example
The code for Implement infinite loop using while loop
// Scala program to implement infinite loop
// using "while" loop
object Sample {
def main(args: Array[String]) {
while(true)
{
printf("Hello");
}
}
}
/*
Output:
Print "Hello" message infinite times
*/
Code by IncludeHelp,
on August 12, 2022 23:32