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

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.